J
jonjon
Hi,
I'm developing a program which allows to dynamically associate form elements
(Input, Select, ...) to forms. Those elements are defined via CSS as abolute
positionned and they may be inside a DIV. The number of forms can be
unlimited (for example the user can associate one or many element to a
form). The philosophy of the program is to graphically (WYSIWYG) associate
any nmber of elements to any form.
It's getting harder with the generation of this webpage: How can I associate
the elements which could be part of a DIV or not to the same form ? I mean
if I have a select in the web-page and an input in a div of the same page,
which are both associated to the exact same form, how could I generate
efficient code ? I tried many things and none of them seems to work
correctly. Here is what I tried:
1- Use "Form.appendChild" to add the elements when onSubmit happens. This
could work however when an element is in a DIV and is appended to a child,
its position is changed
2- Create hidden fields in the form and dynamically set their value when
onSubmit occurs. This time the problem is how to handle possible invisible
elements ? And how to handle radio, check or multiple select ?
3- Create a mirror of the elements in the form and set them not as invisible
(or they won't be included in the form) but out of the web-page or 0x0 width
and height... this is extremly heavy in size and in management.
The ideal solution would be to dynamically create a form which handles all
associated elements when it is submitted, and without modifying the
appearance or position of thos elements.
If you have any suggestions, thought or starting point about this, I will
greatly appreciate your comments.
Thank you very much and best regards,
John.
I'm developing a program which allows to dynamically associate form elements
(Input, Select, ...) to forms. Those elements are defined via CSS as abolute
positionned and they may be inside a DIV. The number of forms can be
unlimited (for example the user can associate one or many element to a
form). The philosophy of the program is to graphically (WYSIWYG) associate
any nmber of elements to any form.
It's getting harder with the generation of this webpage: How can I associate
the elements which could be part of a DIV or not to the same form ? I mean
if I have a select in the web-page and an input in a div of the same page,
which are both associated to the exact same form, how could I generate
efficient code ? I tried many things and none of them seems to work
correctly. Here is what I tried:
1- Use "Form.appendChild" to add the elements when onSubmit happens. This
could work however when an element is in a DIV and is appended to a child,
its position is changed
2- Create hidden fields in the form and dynamically set their value when
onSubmit occurs. This time the problem is how to handle possible invisible
elements ? And how to handle radio, check or multiple select ?
3- Create a mirror of the elements in the form and set them not as invisible
(or they won't be included in the form) but out of the web-page or 0x0 width
and height... this is extremly heavy in size and in management.
The ideal solution would be to dynamically create a form which handles all
associated elements when it is submitted, and without modifying the
appearance or position of thos elements.
If you have any suggestions, thought or starting point about this, I will
greatly appreciate your comments.
Thank you very much and best regards,
John.