mootools表单json post请求
mootools form json post request
我想要一个动态表单上的request.JSON
。
是否可以通过表单id将完整的表单POST?
<table>
<form id="form">
<tr>
<td>username</td>
<td><input type="text" id="username"></td>
</tr>
<tr>
<td>password</td>
<td><input type="password" id="password"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="go" value="go"/></td>
</tr>
</table>
在脚本方面:
$('go').addEvent('click',function( event )
{
event.stop();
var myForm = document.id('form');
var request= new Request.JSON (
{
url: 'check_login.php',
method: 'post',
data:
{
form: myForm
},
onSuccess: function( response )
{
if ( response.status )
{
document.location = "home.php"
}
else
{
$('response').addClass('error');
$('response').set('html', response.message);
}
},
});
request.send();
在php脚本中,我想通过$_POST变量进行检查。但我找不到这样做的方法。实际上我什么都没得到。
greetz
当然,看看这个链接,它展示了如何做到这一点:
http://demos111.mootools.net/Ajax.Form
它基本上是通过您的ID选择表单,添加一个监听器来提交事件,当它出现时,它会按照您想要的方式发送所有表单:-)
相关文章:
- 当我在form_for中的text_field_tag中点击Enter时,如何禁止发出POST请求
- 为什么 AJAX POST 请求不起作用
- Ajax POST请求没有'我不了解PHP
- 防止双击执行两次jQuery post请求
- Javascript XMLHttpRequest——只有第一个POST请求有效
- 如何使用Javascript获取POST请求填充的元素的值
- NodeJS中POST请求的请求体为null
- 在Fiddler JavaScript中识别POST请求
- DreamFactory REST API POST休息/用户/会话请求总是在IE9中返回错误
- 使用application/x-www-form-urlencoded使用node.js在post请求中发送数组
- 打开一个选项卡,并在firefox网络扩展中向其发出POST请求
- 通过AJAX向同一页面发送POST请求,并使用$_POST获取值
- Ajax Post请求不起作用
- 如何在cloud9中向server.js发送post请求
- mootools表单json post请求
- 可以'无法在CasperJS中复制POST请求
- node.js请求POST数组“;第一个参数必须是字符串或缓冲区;
- PythonBottle:访问请求POST数据中的数组变量
- NodeJS请求POST图标
- Yii框架2.0 AJAX请求POST方法