I am trying to pass a vaule to a text field in a form and am having trouble doing so. I have images with javascript like this
which calls this functionCode:<img src="/images/add.jpg" width="19" height="19" alt="Add Your Selection" border="0" onClick="parent.passclr(clr_array = new Array('5233-12'));">
and this formCode:function passclr(clr_array) { document.order_form.id[2].value = clr_array[0]; }
The problem is with the [] in the name of the field id[2]. If I change the name the script works fine, but I have to have it called id[2] because of the shopping cart program I am using. Any ideas on how to get the value to the text field?Code:<form name="order_form" action="http://www.mysite.com/product_info.php/action/add_product" method="post"> Product:<br /> <input type="text" size="15" name="pro" value=" " /><br /> Model #:<br /> <input type="text" size="5" name="mod" value=" " /><input type="text" size="5" name="products_id" value=" " /><br /> Upholstery #:<br /> <input type="text" size="15" name="id[2]" value=" " /><br /> Starting Price:<br /> <input type="text" size="15" name="spr" value=" " /><br /> Upholstery Price:<br /> <input type="text" size="15" name="upr" value=" " /><br /> Total:<br /> <input type="text" size="15" name="tot" value=" " /><br /><br /> <input type="image" src="/images/add_to_cart.jpg" width="80" height="20" alt="Add To Cart" border="0"> </form>


Reply With Quote

Bookmarks