A little Javascript ineptitude?
I should know better but I cant seen to get this straight? I am trying to use user input in a form to identify and use a variable to fill the user input field with that variable. what it is is a PayPal hosted button_ID and i have 30 of them and I want the user to input a number between 1-30 and have that number relate to the corresponding variable. Here's the code that I have but I cant seem to get it to work in the form:
////
<script type="text/javascript">
function(){
var(1)=1984130
var(2)=1984144
var(3)=1984159
var(4)=1984177
var(5)=1984188
var(6)=1984205
var(7)=1984213
var(8)=1984222
var(9)=2102934
var(10)=2102955
var(11)=2102976
var(12)=2102993
document.form.ChronoContact_part2.hosted_button_id .value=var
}
</script>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="">
<p align="center">
<input type="text" name="hosted_button_id" size="20"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="" width="122" height="47">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</p>
</form>
////
Any help would be appreciated
|