"Repeating" Form

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Crashin
Forum Contributor
Posts: 223
Joined: Mon May 06, 2002 3:42 pm
Location: Colorado

"Repeating" Form

Post by Crashin »

I'm working on a form for a client that has a group of elements that may or may not be repeated by the users. As a simple example, a person might enter information for one contact and then click "Done," whereupon the form's information will be E-mailed. However, the user should also have the option to click "Add" and add another contact, as many as they'd like. When through, they can then click "Done" and all contacts will be E-mailed.

Any thoughts on how to handle this? I presume arrays are the answer, but my JS skills aren't so great regarding arrays. :?:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you might add another <input>-element to your form.
take a look e.g. at http://www.pxl8.com/innerHTML.html (DOM Compliant "innerHTML" / "innerText" for Netscape 6)
User avatar
Crashin
Forum Contributor
Posts: 223
Joined: Mon May 06, 2002 3:42 pm
Location: Colorado

Post by Crashin »

That's pretty slick...thanks for the link! 8)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I had to deal with some XML-dudes lately. Using the DOM-functions for creating and iterating elements was a natural choice because we could talk nearly the same language :D
Post Reply