Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: "Building" field names?
07-11-2005, 01:44 PM #1
- Join Date
- May 2005
- Thanked 0 Times in 0 Posts
"Building" field names?
Please can anybody tell me how to do this:
I'm working with a shopping cart and for every item selected from a catalogue, the user must enter the quantity.
The problem I have is, due to the fact that the quantity field changes its name for every product selected, how can I
I've tried to "build" the name of the fields in JS scripts, but it doesn't work.
I'm attaching an example of my JS:
07-11-2005, 01:55 PM #2
- Join Date
- Jun 2002
- Thanked 236 Times in 233 Posts
Use square bracket notation. (See my sig for more info)
Code:var name_field = document.nameOfTheForm.elements["form_cart" + num];
Tower of Hanoi Android app (Ad-FREE!)
Tower of Hanoi Android app (FREE!)
Tower of Hanoi Leaderboard
Samegame Facebook App
Samegame Facebook App Leaderboard
vBulletin 5 Floating Bar extension
vBulletin 5 Slideshow extension
vBulletin 5 Quote Selected Text extension
vBulletin 5 Profile Preview Tooltip extension