Search code examples
tapestry

"Validate" part of form


I have a form with form components. Now I just want to "submit" a part of it for validation check. So I don't want to submit the whole form, but just 1 textfield and 1 select so it can be validated to show a warning if necessary. When the whole form is submitted this validation does not happen, as it was just a warning, not incorrect input.

I could create a mixin that fires a Tapestry event from javascript with the values of the textfield and the select and then do the checks and when needed show a warning with javascript.

But if there is a more simple/existing solution I'd like to hear it.

Thanks


Solution

  • You might find my observe mixin useful. It can attach to any clientside event (eg onchange) and can pass multiple field values if you'd like to validate as a group.

    http://t5stitch-lazan.rhcloud.com/observedemo