Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java script Validation in struts form

 
unnii
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the generated HTML. That should help answer your question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic