•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,584 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3313 | Replies: 3
![]() |
•
•
Join Date: Sep 2005
Posts: 12
Reputation:
Rep Power: 4
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
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,166
Reputation:
Rep Power: 7
Solved Threads: 59
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
<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.
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,166
Reputation:
Rep Power: 7
Solved Threads: 59
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- 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



Linear Mode