I have a jsp where i have two buttons. Each button runs a script on click and then in the script i invoke submit(the action is to a servlet)... my problem is when the script invokes submit, it goes to the servlet...but the value of the button that was clicked is not read...... Kindly provide a solution.....

You been offered help in your previous thread. What is wrong with approach adatapost suggested?

here my prob is the servlet doesnt recognise the particular button clicked....... and the name of the button is not read in the servlet..... when i print the value and see it displays null.....

  1. I think adatapost approach is better then messing around with JavaScript
  2. If you want help you better show code, we have no idea what you tried and blind advice will take forever

In that previous post, it helped.. but in this problem i m suggesting, there is a script that has to run once the button is clicked and then it is forwarded to servlet. so i wanted to know what can be done to read the value of the button in the servlet... i used request.getParameter()...but when i print the value and see, it returns null.....

when using request.getParameter, the parameter must be in the url.
so make sure when u call the servlet the name of the button has been sent and the url will look something like this

/someservlet?buttonname=xyz
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.