You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ian Godman <ia...@yahoo.co.uk> on 2007/08/26 10:17:51 UTC

AJAX form submit and validation

Hi

I have a form that is submitted by ajax.

I have validation on fields of the form.

Using AjaxFormValidatingBehavior the form will be validated and error messages displayed when the onblur event is used.

However this is not what I need as the validation of one field depends on another. I have tried to set the AjaxFormValidatingBehavior to onsubmit but it appears that if the form is invalid then its not submitted so no errors are displayed.

Is there any way I can validate my form using ajax only when it is submited ?


Ian




      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

Re: AJAX form submit and validation

Posted by Gerolf Seitz <ge...@gmail.com>.
concerning "one field depends on another":
have you already taken a look at
http://cwiki.apache.org/confluence/display/WICKET/Validating+related+fields?
the code is still 1.2, but it should get you started.

hth,
  gerolf

On 8/26/07, Ian Godman <ia...@yahoo.co.uk> wrote:
>
> Hi
>
> I have a form that is submitted by ajax.
>
> I have validation on fields of the form.
>
> Using AjaxFormValidatingBehavior the form will be validated and error
> messages displayed when the onblur event is used.
>
> However this is not what I need as the validation of one field depends on
> another. I have tried to set the AjaxFormValidatingBehavior to onsubmit but
> it appears that if the form is invalid then its not submitted so no errors
> are displayed.
>
> Is there any way I can validate my form using ajax only when it is
> submited ?
>
>
> Ian
>
>
>
>
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
> it
> now.
> http://uk.answers.yahoo.com/