【发布时间】:2011-08-11 11:47:05
【问题描述】:
我在表单内的一个文本区域上使用 jQuery 所见即所得编辑器插件,我想对其应用验证。所见即所得的 jQuery 插件正在生成 iframe,所以我需要检测 if there is any text inserted inside the iframe 而不是文本区域。
<div class="wysiwyg" style="width: 581px;">
<ul class="panel" role="menu">
<div style="clear: both;"></div>
<iframe id="id_message_bodyIFrame" frameborder="0" src="javascript:false;" style="min-height: 170px; width: 573px;" tabindex="0">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body style="margin: 0px;">
my text I want to find if exists
<br _moz_dirty="">
</body>
</html>
</iframe>
</div>
<textarea id="id_message_body" title="Please add a message on the text box above." name="message_body" cols="70" rows="10" style="display: none;"></textarea>
<div id="req_message_body" class="req" style="display: none;">This is required</div>
</div>
任何想法如何查找是否已在 iframe 中插入文本并在其旁边创建错误消息,例如 <div id="err"> This field is required</div>?感谢您的帮助!
【问题讨论】:
标签: jquery jquery-plugins jquery-selectors