aspose file tools*
The moose likes Struts and the fly likes How to disable the validation when th Cancel button is clicked (usingStrut validator) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to disable the validation when th Cancel button is clicked (usingStrut validator)" Watch "How to disable the validation when th Cancel button is clicked (usingStrut validator)" New topic
Author

How to disable the validation when th Cancel button is clicked (usingStrut validator)

Usera User
Greenhorn

Joined: Jul 13, 2005
Posts: 21
I am using strut validator and set the fields in the form is required. When the user clicks the submit button with empty fields, the javascript will block the submit. However, when the user click the Cancel button, the javascript also block the submit !

So, how to make the validator to function only for the submit button ?

Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Ar you using the <html:reset> tag for the cancel button? Struts should handle the disabling of javascript validation if you use this tag.
[ July 13, 2005: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
kwwong wong
Ranch Hand

Joined: Feb 15, 2002
Posts: 56
Thanks Merrill Higginson. I use the <html:cancel> and it works. Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to disable the validation when th Cancel button is clicked (usingStrut validator)