使用带有word-press插件的Jquery序列化表单时出错?
Jquery coding:
jQuery("#btnsave").click(function($){
jQuery("#dv").load("http://localhost:880/wordpress/?page_id=12?myval=myval&"+ $("#frm").serialize());
});
PHP编码
<form id="frmtest1" name="frmtest1">
<table style="width:100%;border:1px;">
<tr>
<td colspan="2" align="center">Register</td>
</tr>
<tr>
<td align="right">UserName</td><td align="left"><input type="text" id="txtusername"/></td>
</tr>
<tr>
<td align="right">Password</td><td align="left"><input type="text" id="txtpassword"/></td>
</tr>
<tr>
<td></td><td align="left"><input type="button" id="btnsave" name="btnsave" value="Save" />
<input type="submit" value="Submit" />
</td>
</tr>
<tr>
<td colspan="2">
<?php
if(isset($_GET['myval']))
{
echo $_GET['txtusername'];
return;
}
?>
</td>
</tr>
<tr><td colspan="2" align="center" id="dv"></td></tr>
</table>
<div id="divmsg"></div>
</form>