Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jwysiwyg到php_Php_Jquery - Fatal编程技术网

jwysiwyg到php

jwysiwyg到php,php,jquery,Php,Jquery,我正在使用这个基于jQuery的jWysiwyg。 如何将$('#wysiwyg').val()的值传递给php脚本。例如,要在警报框中显示jwysiwyg的值,我使用 <form name="form1" method="post" action="sendmail.php"> <textarea name="wysiwyg" id="wysiwyg" rows="5" cols="103"></textarea> <input ty

我正在使用这个基于jQuery的jWysiwyg。

如何将
$('#wysiwyg').val()
的值传递给php脚本。例如,要在警报框中显示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>

我需要的是如何在submit控件中传递jwysiwyg的值,以及如何在按下按钮时调用“logout.php”?

类似于:

<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>
$.post('logout.php', { "val": $('#wysiwyg').val() }, function(response) {
  alert('response')
});