473,320 Members | 2,024 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,320 software developers and data experts.

Creating new form elements on a webpage

Is it possible with JavaScript to create new form elements on a
webpage that has already loaded in the browser? For example, what I am
hoping to do is have a text field for a name and a link that lets them
add another text field for another name etc. I believe I can do this
on a DIV but haven't looked at coding it yet. Any thoughts, pointers
etc?

Bill H

Aug 24 '07 #1
1 1179
RobG wrote:
[...]
To achieve the above in IE 6, the control *must* be a child of the label
and the label and control must have matching for and id attributes
respectively.
Ooops, IE only requires matching for and id attributes, the control
doesn't need to be a child of the label.

But IE doesn't successfully associate the control with the label if
there aren't matching for and id attributes, even if the control is a
child of the label.
--
Rob
"We shall not cease from exploration, and the end of all our
exploring will be to arrive where we started and know the
place for the first time." -- T. S. Eliot
Aug 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Michal Mieszkowski | last post by:
i have a block of html code looking like this <FORM name=myform> <INPUT type=text name=firstname> <DIV id=mydiv> <INPUT type=text name=address> </DIV> </FORM> i can access firstname field...
4
by: James Bond 007 | last post by:
I am a novice to Javascript (can do simple text-based pop-ups, but not familiar with variable manipulation). I would like to have a Javascript that gives me the start time (I don't care about...
7
by: Ant | last post by:
Hi, I'm, having some problems with this function. function displayElements() { for (i=0;i<document.forms.elements.length; ++i) { document.writeln(document.forms.elements.value); }
7
by: Nick Calladine | last post by:
Hi On my form i have multiple select which all have an id value total1, total2, total3 etc so i am trying to detect how many there are and then use this to caculate a total. Is there a...
4
by: Zhang Weiwu | last post by:
This is really very stange. I have a form like this: <form id="form_A"> xxxx </form> This form is on one page in a page of a web application, it is the only form on that page. on the end of...
2
by: Ben | last post by:
My current project requires me to create part of a form that is created on the fly. The project consists a list of entries to an event. The name and address and such is easy. The design is detup so...
0
by: yawnmoth | last post by:
I'm trying to get a list of all the input elements of a form tag and am having some difficulty doing so. First, here's my XHTML: <div> <form action=""> <input type="text" name="a" /> </div>...
5
by: yawnmoth | last post by:
I'm trying to get a list of all the input elements of a form tag and am having some difficulty doing so. First, here's my XHTML: <div> <form action=""> <input type="text" name="a" /> </div>...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.