This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Using struts validator to check onchange events. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using struts validator to check onchange events." Watch "Using struts validator to check onchange events." New topic
Author

Using struts validator to check onchange events.

Karthik Muthukumaraswamy
Greenhorn

Joined: Oct 30, 2006
Posts: 12
Hello everyone,
I am using Struts validator framework to validate form fields. I have been using it for client side validations when the form is submitted. Is it possible to couple the validator checking with onChange events?

For example,
is it possible to check whether an input field's value is an Integer during onChange event for that field.

Thank you.
-Karthik.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60804
    
  65

We have a forum dedicated to Struts questions. I'll move this post there for you.
[ October 30, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I've never tried this, but I see no reason why you couldn't do it. Just use your browser's "view source" function to see the generated JavaScript code for the page. Then, see what function is being called by the generated code to validate the field you're interested in and call that same function from its onchange event.


Merrill
Consultant, Sima Solutions
Karthik Muthukumaraswamy
Greenhorn

Joined: Oct 30, 2006
Posts: 12
Thanks Merill. I will try to see to implement it with your suggestion in mind. I will keep you posted.
-Karthik.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Using struts validator to check onchange events.
 
Similar Threads
struts validator
Struts 1.2 - Client and Server-side validations
Struts Live - validator form
How to check 2 fields are equal or not
Have any problem using validator