我正在使用这个基于jQuery的jWysiwyg。
http://code.google.com/p/jwysiwyg
如何将$('#wysiwyg').val()的值传递给php script。例如,为了在警告框中显示jwysiwyg的值,我使用
<form name="form1" method="post" action="sendmail.php">
<textarea name="wysiwyg" id="wysiwyg" rows="5" cols="103"></textarea>
<input type="submit" name="Submit" value="Login"></input>
<input type="button" value="Alert HTML" onclick="alert($('#wysiwyg').val());" />
</form>我需要的是如何在提交控件中传递jwysiwyg值的值,以及如何在按下按钮时调用"logout.php“?
发布于 2010-06-06 14:46:26
类似于:
<form name="form1" method="post" action="sendmail.php" id="sendmailform">
<textarea name="wysiwyg" id="wysiwyg" rows="5" cols="103"></textarea>
<input type="submit" name="Submit" value="Login"></input>
<input type="button" value="Alert HTML" onclick="$('#sendmailform').attr('action','logout.php').submit();" />
</form>总有一种选择是以ajax的方式,使用$.post (http://api.jquery.com/jQuery.post/)
$.post('logout.php', { "val": $('#wysiwyg').val() }, function(response) {
alert('response')
});https://stackoverflow.com/questions/2983331
复制相似问题