Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to read value of button in servlet  RSS feed

 
gayatri umesh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ARG: added code tags]

here, on the click of both buttons "Add" and "Update",the control should go to the servlet.While clicking Update, the script runs and then the control transfers to servlet. But the name of the button Update is not read. What should be done so that the button value will be read in the servlet and the corresponding action takes place.
please help..
 
mark benz
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To read a value of a button in Servlet, it has to be of type 'submit' Not 'button'.

To achieve your goal, you can do something like:

hth


Hint: try to use 'code tages' for your code, that way it will be easier for other folks to read.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are bound to use buttons for whatever reason, you could use hidden fields to carry the content of the buttons.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!