File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Java script Validation in struts form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Java script Validation in struts form" Watch "Java script Validation in struts form" New topic

Java script Validation in struts form


Joined: Jan 21, 2008
Posts: 23
Hi Guys,

I written a function to validate on clicking Add button(submit) but the function is getting fired on clicking Add(html:submit) and Cancel(html:cancel).

i have textboox named 'categoryName' and button named 'Add' and 'cancel'

I written a javascript for a form like the following:

and i call the function like :

i have two button called Add, Cancel as follows:

David Newton

Joined: Sep 29, 2008
Posts: 12617

Take a look at the generated HTML. That should help answer your question.
wood burning stoves
subject: Java script Validation in struts form
Similar Threads
Requested Resource Not Found Error
html:cancel html:submit
How to use Cancel button in DispatchAction
LookupDispatchAction + html:cancel
spaces while populating using s:iterator