473,662 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add extra input box on button click

44 New Member
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 would be a form in a form using vbscipt and ADO

Expand|Select|Wrap|Line Numbers
  1.  
  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'>
  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>
Aug 6 '08 #1
3 3452
acoder
16,027 Recognized Expert Moderator MVP
This is not an HTML problem.

Do you want this functionality without unloading/refreshing the page? If you do, you'll need JavaScript and possibly Ajax. If not, this is an ASP question.
Aug 6 '08 #2
yimma216
44 New Member
I would try ASP then. Thanks
Aug 10 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
OK, good luck.
Aug 11 '08 #4

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

Similar topics

4
17247
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would do myDomElement.click and the mouse doesn't matter, but in the case of an input image element, what happens is the submitted url has something like "?x=12&y=7" appended to it (the numbers vary per mouse position on the clicked element). If you hit...
15
28948
by: Mattia | last post by:
Hi! I have a <form> that can be submitted thruogh three buttons and I need to tell witch one was pressed when the form was submitted. I now do it with 3 <input type="submit" name="..." value="..."> with <input type="submit" ...> the only name-value values submitted (pushed into the query string) is the one of the submit button that was pushed (if you have many of them). Ex:
6
7549
by: Skip Hollowell | last post by:
I am working on a menu bar for a site, and am using buttons in the bar (because the customer wants to use accessKeys for each selection, apparently it is too much work to click on them with a mouse, but I digress) It seems that the longer the text is in a button, the more padding there is around that text in the button, thus making the button itself much to wide, and wasting too much space on the page. I have tried width:auto in the...
5
5460
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and replacing it with a button of my own background color and text. The file paths I'd like displayed in a textarea and then the files uploaded at once.
3
12917
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input type=submit value='Done'> </form>
2
2077
by: HVG | last post by:
Hi, does anyone know why using ".click()" on a <INPUT type="file"> control should be a problem? - the html file selction control is on a very plain webform page with just the <input type="file"> control and a submit button. - the ".click()" method is simply used to automatically open the file selction dialog box so the user doesn't have to click "Browse". (likewise the form is automatically submitted when the user selects a file). The...
15
4753
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
1
3468
by: namanhvu | last post by:
Hi everyone, I'm trying to create a form where the radio button is automatically selected when the input text field beside it is clicked. I know I need to use "onClick" somewhere but I don't know how. With links I found it it would work like this: <SCRIPT LANGUAGE="JavaScript"> function click(which) {
11
12349
by: Mike Harrison | last post by:
Hi, I have some simple HTML like this: <div id="container" style="width:100%;"> <input type="text" <input type="button" style="float:right;" value="Click here..."> </div> I want the button to remain the normal size and be right-aligned, and the edit box to automatically take up the remaining width of the container.
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.