There's a section where I'm trying to add a dynamically generating form...
Basically I'll have a button that when pressed will generate textbox, checkboxes, radio buttons, etc, and I'll have another button to delete it if needed..
Another problem is that I'm sending this form to a php page to get the data processed, and I don't know how to handle unexpected dynamically generated forms' datas...
Somebody help me please?
could you show me an example with code?
the 2nd way? createElement?
Alright guys, new problem
A nice guy named low tech sent me a link on dynamically generating form by appending elements to divs with functions. It worked. However, there's a problem with the radio buttons.
The method of appending elements just copied and pasted the existing form and appended it to existing code, so all the new radio buttons generated have the SAME NAME...
so if i generate 4 or 5 new forms, they have radio buttons with the same name, so i can only select one button out of 4-5 forms.. BIG PROBLEM.. I can't think of a way around this, can someone help me?
generally it's done with an incrementing variable and the function that creates the fields is set up so that every time it is called that number goes up one and is appended to the name (or id or whatever), thereby keeping it unique.
there are other ways, but that would seem to be easiest.
if you're stuck, show some code - I'm sure someone will help you out.
But the ones in the first form are COMPLETELY SEPARATE from those in the 2nd or 3rd form, etc.
Radio button names that are the same *IN A SINGLE FORM* are grouped, but they are *NOT* grouped across forms.
You "solved" a problem that doesn't exist!
Oh sorry I didn't give the full details of the problem.. These checkboxes are only part of a giant form, when I was saying I was "replicating the form" i meant i was replicating a part of the form, not the entire form.