views:

316

answers:

1

Hi,

I am using motools script for client side validation of web form. here is the link for that script http://mootools.floor.ch/en/demos/formcheck/

My problem is that when only form validation is used and form is subimitting with normal method is fine but when form validation is used and form is submitting using AJAX with motools. so its not working.

So how could i do this both.

  1. Form Validation.
  2. Ajax Form Submit.

Thanks Avinash

A: 

erm - formCheck seems to support submission by ajax natively. here are some options listed in the script head:

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.

etc.

Dimitar Christoff