Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Text Fields

Status
Not open for further replies.

chris5g

Programmer
Joined
Aug 21, 2001
Messages
48
Location
US
I want to be able to have one text field showing but if the user needs to use another, they'll be able to click on a button and a second one appear and so on. Is this possible without refreshing?
 
posted this awhile ago but couldn't find the thread but here it is again
<html>
<head>
<script language=&quot;javascript&quot;>
<!-- function to add field -->
function addBox() {
var lng = frm.length + 1
var Nfield = &quot;numbers&quot; + lng
//alert(Nfield);
frm.innerHTML += '<input type=&quot;text&quot; name=&quot;' + Nfield +'&quot; class=txtbx><br><br>'

}
</script>
</head>
<body>
<form name=&quot;frm&quot;>
<input type=&quot;text&quot; name=&quot;numbers&quot;>
<input type=&quot;button&quot; value=&quot;Add a field&quot; onClick=&quot;addBox()&quot;>
</form>
</html>

_________________________________________________________
for the best results to your questions: FAQ333-2924
01001111 01101110 01110000 01101110 01110100
onpnt2.gif
[/sub]
 
Wow that is awsome! Thanks!

I has posted this in ASP but no one knew and said to try here. I tried to do a search but it was down.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top