473,322 Members | 1,425 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,322 software developers and data experts.

Add more text fields to existing text fields.

Beginner javascipt/vbscript.

I hava a form, which has five lines to enter at start. I want to have a button to add more lines when it is clicked. However, I am having trouble with it. This is written in vbscipt and ADO.

Expand|Select|Wrap|Line Numbers
  1. Code: ( text )
  2. <%
  3. Const linesNo = 5
  4. Dim counter
  5.  
  6. <html>
  7. .....
  8.  
  9. <form action='return_form.asp' method=post>
  10. <input type=hidden name='task' value='add'>
  11. <table>
  12. .....
  13.  
  14.  
  15.  
  16. <%
  17. if request("task")="lines" then
  18.      linesNo = linesNo + 5
  19.      response.write "return_forms.asp"     
  20. end if 
  21.      
  22. counter = 0
  23. Do While counter < linesNo
  24. %>
  25.  
  26. <tr>
  27. <td  width=20%><input type=text size="20" maxlength="30" name='part_no_<%=counter%>' value='<%=request("part_no_")%>'/></td>
  28. </tr>
  29.  
  30. <%
  31. counter = counter + 1
  32. Loop    
  33. %>
  34.  
  35. <tr>
  36. <td width=20%><form action='return_form.asp' method=post><input type=hidden name='task' value='lines'></form>
  37. <input type=submit name='lines' value='Add Lines'></td>
  38. </tr>
  39.  
  40. ......................(some codes)
  41. <tr>
  42. <td></td>&nbsp;<td><input type=submit value="Save & Print"></td>
  43. </tr>
  44.  
  45.  
  46. </table>
  47.  
  48. </form>
  49.  
Thanks
Aug 11 '08 #1
1 1346
acoder
16,027 Expert Mod 8TB
If you're using JavaScript to add text fields dynamically, you only need a normal button, not a submit one. In the onclick handler call a function that adds the fields, e.g.
Expand|Select|Wrap|Line Numbers
  1. var textfield = document.createElement("input");
  2. textfield.type = "text";
  3. // set other properties such as name, id, value, etc.
  4. // get element to append to
  5. elem.appendChild(textfield);
Aug 11 '08 #2

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

Similar topics

1
by: Serious_Practitioner | last post by:
Hello, all - I want to get a customer name, address and so forth from a customer table using either a SELECT statement in a VBA procedure or in a query. The user should be able to put a customer...
3
by: Alexander Widera | last post by:
Hi, i connect to a ms sql2000server via SqlConnection. if i make an SqlCommand "INSERT INTO mytable (mytext) VALUES (@mytext)" (or i make an update), and i pass the parameter @mytext a simple...
13
by: sonald | last post by:
Hi, Can anybody tell me how to change the text delimiter in FastCSV Parser ? By default the text delimiter is double quotes(") I want to change it to anything else... say a pipe (|).. can anyone...
16
by: pmatzek | last post by:
I am attempting to automate a process involving importing a .txt file into an existing table, changing a date in each record, then exporting the table, again as a .txt file. One field contains a...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
1
by: peck2000 | last post by:
Related to my earleir post ... this is the same project to re-purpose the Classifieds application in BEGINNING ASP 3.0 (Wrox) to a comicbook database ... This is a brainteaser that should have...
0
Dököll
by: Dököll | last post by:
Continued from: http://www.thescripts.com/forum/thread762010.html -VB 6.0 Professional -Microsoft DAO 3.6 Reference Search Database table... An attempt to fetch data housed in Access:
9
by: RICHARD BROMBERG | last post by:
Please bear in mind that I am a newbie. I am posting this question a second time because the responses to my earlier post were a little wide of the mark. So, here goes: I am using Access 2000...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.