shokora
03-20-2008, 10:54 PM
I'm relatively new to JS, and I got thrown a project where I'm basically trying to learn now to write it on the fly.
The problem: My company has a form on the local intranet that allows users to input some information (duh) and gives them the option to add additional steps as necessary. The issue is that these additional steps are not single input fields. The "Add another step" button outputs a large table that has somewhere along the lines of 15+ input fields.
There are plenty of tutorials out there on how to add a single input box (like this (http://binnyva.blogspot.com/2006/01/dynamic-form-field-generation-in.html)), but those just don't help me due to the scale of this assignment.
Right now, I am inserting the HTML steps dynamically from the JS function based on a step number counter. The insert includes the entire table, input fields and all. It's being placed into the HTML with innerHTML, and it works. [Clarification: I'm appending the new steps into a placeholder div with innerHTML.]
However, I'm having issues getting the values from the dynamically generated fields to post so that my PHP can access it and update the database accordingly.
I'm sorry that I can't post any snippets of the code, due to NDA requirements, so I hope I was detailed enough in explaining. Any help would be great!
The problem: My company has a form on the local intranet that allows users to input some information (duh) and gives them the option to add additional steps as necessary. The issue is that these additional steps are not single input fields. The "Add another step" button outputs a large table that has somewhere along the lines of 15+ input fields.
There are plenty of tutorials out there on how to add a single input box (like this (http://binnyva.blogspot.com/2006/01/dynamic-form-field-generation-in.html)), but those just don't help me due to the scale of this assignment.
Right now, I am inserting the HTML steps dynamically from the JS function based on a step number counter. The insert includes the entire table, input fields and all. It's being placed into the HTML with innerHTML, and it works. [Clarification: I'm appending the new steps into a placeholder div with innerHTML.]
However, I'm having issues getting the values from the dynamically generated fields to post so that my PHP can access it and update the database accordingly.
I'm sorry that I can't post any snippets of the code, due to NDA requirements, so I hope I was detailed enough in explaining. Any help would be great!