Hi fatefree,

Check this blog post: 
http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket
I think this achieves what you want.

Regards,

Daan

On 21 okt 2008, at 15:28, fatefree wrote:


I have been trying to fulfill a requirement of a form, where each field is validated one at a time after losing focus, and the entire form is validated when a user clicks submit. I can see that there are pieces of what I want to
do thats possible, but I haven't been able to put them all together.

What I have tried is using the
AjaxFormValidatingBehavior.addToAllFormComponents(form, "onblur"), but as you probably know this causes the entire form to be validated on the onblur which is both confusing to a user who hasnt been able to put all values in, and also seems to be excessive load as id rather the rest of the form be
ignored.

Then I looked into nested forms with the hope that I could add the same behavior to a nested form, and then a user could submit a parent form which would submit its child forms. While i thought this could be a solution, it
seems that when an inner form is submitted through the onblur behavior
above, the parent form is submitted and validated as well so I have the same problem as I do in the first case. Keep in mind I have no button to submit
an individual field (so i cant call setdefaultformprocessing).

So finally I thought about making every field its own form without being nested, in which case I know the validating behavior will work for every form individually. The only problem (besides having a form for every input, but thats manageable) is that I don't know how to use a button outside of these forms, and force it to submit every form and proceed only if they are all valid. I tried using an AjaxLink and calling process on every form i have a reference to, but that seems to return true every time without any
validation.

Has anyone had a similar requirement or accomplished what I am trying to do? I would be very appreciative of any example or ideas or direction i should
look into to accomplish this. Thanks in advance
--
View this message in context: 
http://www.nabble.com/Ajax-validating-individual-form-fields-tp20090299p20090299.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to