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

check box issue 1

Status
Not open for further replies.

cLFlaVA

Programmer
Jun 14, 2004
6,450
US
make it so the html reads like this:

Code:
<input ... onclick="this.form.elements['unitRefunded-9'].value = this.value;" />

and i will recommend, for the record, to get rid of the hyphon in the field name.

*cLFlaVA
----------------------------
[tt]a frickin' twelve-gauge, what do you think?[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
thanks
Its working

I changed it to

Code:
<input type="checkbox" name="inputUnitIncluded<c:out value='${lotListTO.primaryKey}' />" [b]onclick="this.form.elements['unitRefunded<c:out value='${lotListTO.primaryKey}' />'].value=this.checked" />[/b]
 
I have a hidden field and checkbox whose names are generated dynamically with the values. the value of the key in code below can be +ve or -ve
for example: say key=9 (+ve)
hidden: name=unitRefunded9
checkbox: name=inputUnitIncluded9
say key=-9 (-ve)
hidden: name=unitRefunded-9
checkbox: name=inputUnitIncluded-9
Problem: in check box onclick event
if the name has '-' (unitRefunded-9;-ve key) It is not assigning the checkbox value to the hidden field.(works ok for +ve key values).

onclick="unitRefunded-9.value=this.value" ->NOT GETTING SET

Anybody have any idea how I can set its value.

thanks

Code:
loop start ....

<input type="hidden" name="unitRefunded<c:out value='${lotListTO.key}' />" value="<c:out value='${lotListTO.inputUnitIncluded}' />"/>

<input type="checkbox" name="inputUnitIncluded<c:out value='${lotListTO.key}' />" [b]onclick="unitRefunded<c:out value='${lotListTO.key}' />.value=this.checked" /></td> [/b]
......
loop end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top