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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit Problem

Status
Not open for further replies.

ChrisMcD

Programmer
Nov 8, 2001
5
GB
Hi,

I have two submit buttons on my screen, they both submit to a servlet. The servlet reads in the value of a parameter called "action" if the save button is selected the value should be "true" If the other is selected the value should be "false".

So how do I do that, any ideas?

Cheers,
Chris
 
You could try something like this...

<script>
function doIt(form, theaction){
form.action.value = theaction;
form.submit();
}
</script>

then inthe body have this:

<form action=&quot;myservlet&quot;>
<input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;&quot;>
<input type=&quot;button&quot; value=&quot;save&quot; onClick=&quot;doIt(this.form, 'true')&quot;>
<input type=&quot;button&quot; value=&quot;dont save&quot; onClick=&quot;doIt(this.form, 'false')&quot;>
</form>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top