Ill display my code first and then describe what im trying to do.
Javascript section
form codeCode:function ReadForm(obj1) { var data_array = obj1.os0.value.split('^'); var des=data_array[0]; var amt=data_array[1]; obj1.os0.value = des; }
Last line of the javascript I included is suppose to change the value of os0 when the form is submitted. Before you say use getElementById I will tell you that this is not an option. I am dealing with paypal buttons and this site has over 300 buttons which can not all use the same id. Any help on this one would help out alot.Code:<select name="os0"> <option value="2^1">Two to one</option> <option value="3^2">Three to two</option> </select>
Edit:
Update:
I finally found a way to do it. For the benefit of anyone looking for this solution in the future here it is.
Code:var selectBox = obj1.os0; var selectedItem = selectBox[selectBox.selectedIndex]; selectedItem.value=des;


LinkBack URL
About LinkBacks
Reply With Quote
