Skip to main content

Validation in Struts 2 / Ajax

1 reply [Last post]
andricentivo
Offline
Joined: 2008-10-17
Points: 0

Struts 2 / Ajax provide a validation of form field ONLY after user click submit button. My concern is how can I make Struts2 / Ajax validate a textfield WHEN user move to another textfield but before click the submit button?

2nd question , in Struts 2 there is OGNL for mapping an input with Business Logic such as EJB. Is it better ways than old Struts1 ways?

Andriyana Tresnawan
Centivo, inc
Indonesia

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jesdisciple
Offline
Joined: 2008-05-01
Points: 0

I don't know anything about Struts, but the solution will be based on the [i]onblur[/i] event-handler in JavaScript. Just don't forget to validate your form when it's submitted because JS is unreliable.