Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set form property in jsp

Status
Not open for further replies.

capellone2

Programmer
Jun 21, 2007
1
RO
Hello,
I have in jsp
Code:
<input type="hidden" name="newCommand" value="myvalue"/>

<button type="button" onclick="start();">
<img src="images/common/button/play-button-th.png" alt="Start" />
</button>

<button type="button" onclick="stop();">
   <img src="images/common/button/pause-button-th.png" alt="Pause" />
</button>

<button type="button" onclick="pause();">
  <img src="images/common/button/stop-button-th.png" alt="Stop" />
</button>

I want to set the "newCommand" property differently for each pressed button. For instance, start() would be like
Code:
start()
{
 < ?? set newComamnd="START" >
 submit form
}

How can i do that?

Thank you.
 
This more javascript than JSP, but here's my suggestion:

- Change the button type to submit
- In the onclick, change the newCommand value, that will be picked up server-side upon submission.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top