469,330 Members | 1,246 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

Generate New Form Elements Dynamically

Hi,

I am in the process of creating several forms where a group of elements on the form need to be created dynamically.

For example, in the case of one of the forms, I have a drop down for school, a text box for degree, and a text box for concentration. The form shows 3 of these groupings by default but would like the user to be able to "add more" 3 element groupings if need be and "remove" the additional elements if needed.
The schools drop down is actually a list generated from a database table (using classic ASP).

I see several examples of doing this with static content on the web using Javascript/CSS but not clear on how to incorporate the database piece with it so the dropdown options can be generated from the database table and also the cleanest way to create the new form elements dynamically from the various examples.

If anyone has any suggestions, it would be great!

Thank you!
Mar 26 '08 #1
3 1552
iam_clint
1,208 Expert 1GB
The best way to make it dynamic with the database fields is to make an ajax query to a serverside page (aka your asp classic). you can have it write to the page delimited by commas or something whatever you want then split it in the javascript and use dom to create/remove children and elements. There are examples of ajax on this site.. If you cannot figure this out post a reply.
Mar 26 '08 #2
Hi,

I'm completely new to Ajax so not 100% sure how to do this.
Can you please point me to an example of this if there is one?

Thanks so much!


The best way to make it dynamic with the database fields is to make an ajax query to a serverside page (aka your asp classic). you can have it write to the page delimited by commas or something whatever you want then split it in the javascript and use dom to create/remove children and elements. There are examples of ajax on this site.. If you cannot figure this out post a reply.
Mar 31 '08 #3
This should give you a start:
http://www.matts411.com/webdev/creating_form_elements_with_javascript
Mar 31 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Will | last post: by
1 post views Thread by Srihari | last post: by
1 post views Thread by Scott Zabolotzky | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.