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
https://forums.phpfreaks.com/topic/12739-dynamic-forms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.