使用motools ajax的表格帖子和表格检查与motools形式检查

时间:2009-12-11 12:20:10

标签: javascript ajax mootools

我正在使用motools脚本进行Web表单的客户端验证。 这是该脚本http://mootools.floor.ch/en/demos/formcheck/

的链接

我的问题是,当只使用表单验证并且表单使用普通方法进行分配时很好,但是当使用表单验证并且表单使用带有motools的AJAX提交时。所以它不起作用。

那么我怎么能这样做。

  1. 表单验证。
  2. Ajax表单提交。
  3. 由于 阿维纳什

1 个答案:

答案 0 :(得分:0)

erm - formCheck似乎支持ajax本地提交。以下是脚本头中列出的一些选项:

submitByAjax - you can set this to true if you want to submit your form with ajax. You should use provided events to handle the ajax request (see below). By default it is false.
ajaxResponseDiv - id of element to inject ajax response into (can also use onAjaxSuccess). By default it is false.
ajaxEvalScripts - use evalScripts in the Request response. Can be true or false, by default it is false.
onAjaxRequest - Function to fire when the Request event starts.
onAjaxSuccess - Function to fire when the Request receives . Args: response [the request response] - see Mootools docs for Request.onSuccess.
onAjaxFailure - Function to fire if the Request fails. 

等。