Click to See Complete Forum and Search --> : Changing Content of a form dynamically


davew
02-21-2003, 06:52 AM
With the help of this forum, I have created a Booking form intended to allow users to book for different events, which incorporates Javascript for validation etc.

The idea is to create a template of this form, which would allow the standard form to have details inserted into it to cover Event Description, Date, Venue etc, therby creating an individual booking form for each event offered.

The idea is that the person who is in charge of the event could run a program that would request the details above together with a new filename for the "new" form, and then create what is in essence a copy of the template, which would be referred to as the booking form for the particular event. Links to this booking form would be set up from the description of the event, and we are in business.

Anybody done anything similar ?


Regards


Dave Wilson

khalidali63
02-21-2003, 08:02 AM
I am sure these links will guide you in write direction.You can use DOM to add/remove HTML elements and in these links there are several examples of how to.

cheers

Khalid

http://www.mozilla.org/docs/dom/samples/
http://www.geckonnection.com/

Vladdy
02-21-2003, 11:27 AM
I would make it one form with event specific details filled at the event selection. Server side solution can be made more user and administrator friendly. If you can not (or do not want) to use server side, the effect can be accomplished using javascript.
I wrote a similar thing for a car rental business where reservation form had car specific numbers that had to be changed dynamically based on the car selection.

Suggested approach:
Every event is associated with a js object that stores event specific information and is placed in an individual file.
Have a js file that has information about currently available event objects (in a javascript array)
The form would populate the event specific inputs with information from the file that is looked up after the event selection is made (can be loaded dynamically)
Unless you want it to work in antiques (NS 4.*) and pretenders (Opera) writing DOM compliant code to accomplish the task should be a piece of cake.