Why I called this a revisited issue is because I’ve asked this before in the stackoverflow community. Check this link: http://stackoverflow.com/questions/2293512/web-ui-dynamic-web-forms.
The problem lies in the dynamic generation of components from within a form, for instance, your data-structure follows the one-has-many setup. Take for example a person who has one or more cars, then we would like to have multiple cars to add or to remove from the form.
Again, I tried searching the web for alternatives on what to use re: dynamic forms and the keyword ‘lambda’ appears. A solution has been rediscovered after all this time http://code.google.com/p/jquery-dynamic-form. This solution is the perfect candidate to solve my dynamic forms problem, the code is as simple as this:
I intend to make a simpler example of the code so that it’d be easier to read.
HTML:[cc lang=”php” tab_size=”2″ lines=”-1″]
Just in case the later versions of jquery.dynamic do not work for you, I have included the jquery plugin I used and tested.
I’ve used jquery version 1.4.2.
download source: jquery.lambda