W
Wojtek
Given the following somewhat abbreviated code:
------------------------------------------
<table>
<form name="aForm1" action="doStuff" method="post">
<input type="hidden" name="id" value="1">
<tr onClick="aForm1.myButton.value='View'; aForm1.submit();">
<td>
<input type="submit" name="myButton" value="View">
<input type="submit" name="myButton" value="Edit">
</td>
<td>Value 1</td>
</tr>
</form>
<form name="aForm2" action="doStuff" method="post">
<input type="hidden" name="id" value="2">
<tr onClick="aForm2.myButton.value='View'; aForm2.submit();">
<td>
<input type="submit" name="myButton" value="View">
<input type="submit" name="myButton" value="Edit">
</td>
<td>Value 2</td>
</tr>
</form>
</table>
------------------------------------------
If I click on the View button, then the form gets submitted, and the
form handler reads that the value of myButton as 'View"
But if I click on the row, then no value for the myButton gets passed
to the form handler.
I did try aForm1.myButton[0].value='View'
How do I get the form submit to set the passed value of myButton to
'View'?
------------------------------------------
<table>
<form name="aForm1" action="doStuff" method="post">
<input type="hidden" name="id" value="1">
<tr onClick="aForm1.myButton.value='View'; aForm1.submit();">
<td>
<input type="submit" name="myButton" value="View">
<input type="submit" name="myButton" value="Edit">
</td>
<td>Value 1</td>
</tr>
</form>
<form name="aForm2" action="doStuff" method="post">
<input type="hidden" name="id" value="2">
<tr onClick="aForm2.myButton.value='View'; aForm2.submit();">
<td>
<input type="submit" name="myButton" value="View">
<input type="submit" name="myButton" value="Edit">
</td>
<td>Value 2</td>
</tr>
</form>
</table>
------------------------------------------
If I click on the View button, then the form gets submitted, and the
form handler reads that the value of myButton as 'View"
But if I click on the row, then no value for the myButton gets passed
to the form handler.
I did try aForm1.myButton[0].value='View'
How do I get the form submit to set the passed value of myButton to
'View'?