Hello,
What I want to do is to have a "+" button, so that when you click it, the value of a textfield will be added with one.
Here my jsp code :
**************************************************
td><input type="text" name="quantities(2)" maxlength="10" size="2" value="4">
<input type="button" name="2" value="+" onclick="document.forms[0].quantities(2).value= document.forms[0].quantities(2).value+ 1">
******************************************************
But when I click my +-button it doesnt work!! Nothing change in the textfield.
Does anyone see the problem?
Thanx in advance!
Olivier
-
jsp - accessing a form object problem (1 messages)
- Posted by: Olivier Jennes
- Posted on: March 06 2005 23:06 EST
Threaded Messages (1)
- Hi by Akash Sharma on March 07 2005 03:05 EST
-
Hi[ Go to top ]
- Posted by: Akash Sharma
- Posted on: March 07 2005 03:05 EST
- in response to Olivier Jennes
don't use array notation like quantities(2).
And then document.forms[0].quantity.value++ will give
desired result.
'document.forms[0].quantity.value+ 1' will simply append "1"
to the string representation of quantity's value.
regards
Akash