Hi,
Can someone please tell me where I'm going wrong here.
I'm making my own bill payment system in asp. A Select box is filled with the Names of the Billers.
<option value="<%= rs( "BillerID" ) %>"><%= rs( "BillerName" ) %></option>
And hidden field is assigned a biller reference code.
<input type="hidden"name="BR<%= rs( "BillerID" ) %>" value="<%= rs( "BillerRef" ) %>">
So the BillerID is dynamic for each record, and the BR hidden field is dynamic too.
I would like a select box onChange event that changes an input box "BillerRef" to be equal to the corresponding hidden BR(ID) value.
Is there a way to get this statement (from my select box):
onChange="document.addBill.BillerRef.value= document.addBill.BR1.value;
to Be:
onChange="document.addBill.BillerRef.value= document.addBill.BR*ID OF SELECTED OPTION*.value; ?
The closest I've come is this, but I don't think it gets the options value properly (too many []s?)
onChange="document.addBill.BillerRef.value= document.addBill.BR[this.options[this.options.selectedIndex].value].value;
Any help would be appreciated!
Cheers
Batty
Sorry about the long winded question, I just like to give as much info as possible.
Can someone please tell me where I'm going wrong here.
I'm making my own bill payment system in asp. A Select box is filled with the Names of the Billers.
<option value="<%= rs( "BillerID" ) %>"><%= rs( "BillerName" ) %></option>
And hidden field is assigned a biller reference code.
<input type="hidden"name="BR<%= rs( "BillerID" ) %>" value="<%= rs( "BillerRef" ) %>">
So the BillerID is dynamic for each record, and the BR hidden field is dynamic too.
I would like a select box onChange event that changes an input box "BillerRef" to be equal to the corresponding hidden BR(ID) value.
Is there a way to get this statement (from my select box):
onChange="document.addBill.BillerRef.value= document.addBill.BR1.value;
to Be:
onChange="document.addBill.BillerRef.value= document.addBill.BR*ID OF SELECTED OPTION*.value; ?
The closest I've come is this, but I don't think it gets the options value properly (too many []s?)
onChange="document.addBill.BillerRef.value= document.addBill.BR[this.options[this.options.selectedIndex].value].value;
Any help would be appreciated!
Cheers
Batty
Sorry about the long winded question, I just like to give as much info as possible.