I m using an jQuery wysiwyg editor plugin on one of my textareas inside a form and I want o apply validation to it. The wysiwyg jQuery plugin is generating an iframe
so I need to detect if there is any text inserted
inside the iframe
not the text area.
<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”> 这个领域需要加固;/div>
? 我赞赏你的帮助!