Apologies to Eelco, missed your email ! Very annoying, would  have saved me a 
lot of time!

Many thanks.


Ian

----- Original Message ----
From: Carlos Pita <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, 27 August, 2007 6:50:00 AM
Subject: Re: AJAX form submit and validation

On 8/26/07, Ian Godman <[EMAIL PROTECTED]> wrote:
>
> I worked it out. Very simple solution!
>
> On the AjaxSubmitLink override the onError method and add the feedback
> panel to the AjaxRequestTarget !
>
>
> Ian



Yes, that or setDefaultFormProcessing(false) as Eelco suggested before.
That's not doing validation by hand, just postponing the moment of
validation to fit your needs. Then, when validation should be done, call
process() on the form and that will carry on validation and model updating
as usual. It's as simple as that.


----- Original Message ----
> From: Gerolf Seitz <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Sunday, 26 August, 2007 6:05:00 PM
> Subject: Re: AJAX form submit and validation
>
> have you tried AjaxFormComponentUpdatingBehavior?
>
>   gerolf
>
> On 8/26/07, Ian Godman <[EMAIL PROTECTED]> wrote:
> >
> > Thanks but this does not solve my problem.
> >
> > I am submitting the form via ajax using an AjaxSubmitLink. If the form
> has
> > errors on it then I do not get the submit, if the form has no errors
> then
> > the submit code runs ok. The errors are not displayed.
> >
> > If I add a AjaxFormValidatingBehavior for the onblur event then I can
> see
> > the errors but they check for required fields etc as soon as the first
> field
> > is left therefore displaying errors too soon.
> >
> > With the AjaxFormValidatingBehavior set to onsubmit event I get no error
> > reporting and no submit.
> >
> > I need to validate the entire form only when submit button is pressed
> > pressed. One possibility is to do the validation "by hand" in the submit
> > processing code.
> >
> >
> > Ian
> >
> >
> > ----- Original Message ----
> > From: Gerolf Seitz <[EMAIL PROTECTED]>
> > To: [email protected]
> > Sent: Sunday, 26 August, 2007 2:10:01 PM
> > Subject: Re: AJAX form submit and validation
> >
> > 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 <[EMAIL PROTECTED]> 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/
> >
> >
> >
> >
> >
> >
> >
> >       ___________________________________________________________
> > Want ideas for reducing your carbon footprint? Visit Yahoo! For Good
> > http://uk.promotions.yahoo.com/forgood/environment.html
>
>
>
>
>
>
>
>
> ___________________________________________________________
> 24 FIFA World Cup tickets to be won with Yahoo! Mail
> http://uk.mail.yahoo.com







      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  
http://uk.promotions.yahoo.com/forgood/environment.html

Reply via email to