chronister Posted February 23, 2007 Share Posted February 23, 2007 Hey Folks, I have an input form that is dynamically generated via php/mysql. I am trying to add couple small images to it so the user can increment or decrement the values in the field. I have different images that I am going to use, but here is what I am after. <form name="form"> <!-- this one works --> <input type="text" name="qty" value="5" > <input type="button" value="up" onClick="javascript:this.form.qty.value++;" > <input type="button" value="down" onClick="javascript:this.form.qty.value--;" > <br><br> <!-- This one don't work. I am assuming because of the array part [414] --> <input type="text" name="qty[414]" value="5" > <input type="button" value="up" onClick="javascript:this.form.qty[414].value++;" > <input type="button" value="down" onClick="javascript:this.form.qty[414].value--;" > </form > Can I make the values change on the second one, this is how my form is generated, the 414 part is different for each input field as is the 414 in the javascript. That number or name is dynamic via php and I have to keep it. In the end, there are going to be 80-90 input fields in a 4 across table. Is there a way to make this second one work? p.s. I know nothing of javascript, so I REALLY APPRECIATE any help given. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 23, 2007 Share Posted February 23, 2007 Try this.form['qty[414]'].value. Quote Link to comment Share on other sites More sharing options...
chronister Posted February 23, 2007 Author Share Posted February 23, 2007 Perfect Fenway. It works alone, now I have to get it to work inside my actual form. Thank you very much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.