473,388 Members | 1,207 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 1696
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

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

Similar topics

1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
1
by: Will | last post by:
Hi, I have a problem trying to validate dynamically created html form elements using javascript. I have dynamically created a check box using ASP for each record in a recordset and have given each...
1
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed...
2
by: Afshin eini | last post by:
Hi I have an form in a Html . this form contains a table and I create table rows and Text boxes Dynamically with a JavaScript . when I submit this form to a ASP Page then elements which...
1
by: sam | last post by:
I have form elements which dynamically generated like this... <form name="formA" ...> <input type="select" name="text_1" ...> <input type="select" name="text_2" ...> <input type="select"...
1
by: Scott Zabolotzky | last post by:
I'm sure somebody has to have done this already but I can't find any good references. If I have an XML file with an associated XSD what is the best way to dynamically generate a web form with...
5
by: phpCodeHead | last post by:
I am needing to determine how to go about validating that a field in my form contains only a positive integer. I know that this is fairly simple if the form contains only one element to be...
1
by: stepby | last post by:
Generate the ASP code dynamically Hi All, I would like to ask how to generate the ASP code dynamically? The case is that there are several textbox and the number of textbox is controlled by...
2
by: gubbachchi | last post by:
Hi, I have a form whose elements are created dynamically on selection, i.e. the form has only text boxes and the number of text boxes depends on the users selection, if user selects 3 then 3...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.