| | |
Extending HTML Forms
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2005
Posts: 12
Reputation:
Solved Threads: 0
I am trying to create an HTML form in which user will enter different items (he wants to purchase) in text fields. One text field is used for one item. Now it is not known in advance how much items the user will purchase so we cannot decide the total text fields required in advance. Is is possible to increase the number of text fields (using JavaScript) one by one if the user requires more fields.
Bye
Bye
Yes is the answer, this should get you started a very very basic solution but enough to show you what you need to be looking at to acheive your goal. check out http://www.w3schools.com
and get yourself a copy of the javascript anthology published by sitepoint ISBN 0-9752402-6-9
and get yourself a copy of the javascript anthology published by sitepoint ISBN 0-9752402-6-9
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script type="text/javascript"> var instance = 0; function newTextBox(element) { instance++; var newInput = document.createElement("INPUT"); newInput.id = "text" + instance; newInput.name = "text" + instance; newInput.type = "text"; document.body.insertBefore(newInput, element); } </script> </head> <body> <input type="button" id="btnAdd" value="New text box" onclick="newTextBox(this);" /> </body> </html>
Last edited by hollystyles; Feb 1st, 2007 at 9:51 am.
Only if you tell me what the error message is, and post your current code in code tags. I don;t know how crystal balls work unfortunately 
1. what is the action attribute set to in your form tag?
2. What server-side technology are you using? CGI ? ASP? ASP.NET? PHP? all have their different methods for retreiving the POST data from a submitted HTML Form.

1. what is the action attribute set to in your form tag?
2. What server-side technology are you using? CGI ? ASP? ASP.NET? PHP? all have their different methods for retreiving the POST data from a submitted HTML Form.
![]() |
Similar Threads
- html/php form for .htaccess validation (PHP)
- Passing variables from delphi to html forms (Pascal and Delphi)
- HTML & C++ (C++)
- How to use two forms in asp (ASP)
- Generation html in perl (Perl)
- Html+PHP Forms (PHP)
- Can't send HTML forms (Web Browsers)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Images, thumbnails, and iFrames
- Next Thread: Trouble with changng the scroll color
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxhelp animate array automatically beta box bug calendar cart checkbox child class codes column cookies createrange() css cursor date debugger decimal design dom download dropdown editor element enter error events explorer firefox focus forms frameworks getselection google gwt html htmlform ie8 iframe images index internet java javascript jawascriptruntimeerror jquery jsf jsfile jsp jump listbox maps masterpage math menu microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent php player post problem programming progressbar prototype redirect regex runtime safari scale scriptlets search select session shopping size sql text textarea toggle variables w3c web website window windowofwords windowsxp wysiwyg \n






