Jump to content

dynamic forms


jworisek

Recommended Posts

I have a form where the user inputs multiple line items at once and I am currently passing this to the next page using:

[code]
<select name="blah[]"><option value="">option #1</option>.....</select>
[/code]

so its it a nice array. I have about 8 inputs per line item so this makes it easy to loop through everything and reconstruct it after submitting since I can use the same index in each option per line item.

What I would like to do though is to be able to dynamically update one based on another.

for example, lets say we have products and sizes

Product A: Sizes (Small, Medium, Xlarge)
Product B: Sizes (Xsmall, Large)
Product C: Sizes (Xsmall, Medium, Large, Xlarge)

So I want to have the user select the product and then dynamically update the sizes dropdown menu to only the applicable values. I can do this with javascript for one line item, but it fails when I try to use the [] to put the data into arrays. Does anyone have any experience in this sort of thing and have suggestions? I left a message in the javascript forums but no one has posted yet.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.