Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 492
  • Last Modified:

Create form to input multi records using ASP, VBscript, or Javascript

We want to submit several records into a database table. Currently we do it by importing an Excel sheet, that has the fields in columns, and each row will be a record. How to do this with a webpage, with a link to add an extra line (= record)?

For example, this would be rough example of a table, that we would like to create dynamically line by line on a webpage form:-

record  field1 field2 field3
1            212    34     mod
2            432    54     tran
3            764    21     tour
0
pld51
Asked:
pld51
  • 3
  • 2
  • 2
  • +1
2 Solutions
 
mgfranzCommented:
<form action="doInsert.asp">
Field1: <input type="text" name="field1" /><br>
Field2: <input type="text" name="field2" /><br>
Field3: <input type="text" name="field3" /><br>
<input type="submit" name="submit" />
</form>
0
 
Gurvinder Pal SinghCommented:
create an xml from these values, something like

<records>
   <record id="1" field1="212" field2="34" field3="mod"\>
   <record id="2" field1="432" field2="54" field3="tran"\>
   <record id="3" field1="764" field2="21" field3="tour"\>
</records>

and then submit this string to server using post method

once your have fetched this values are server side, you can create the objects out of it and then save them in db
0
 
mgfranzCommented:
Or maybe I don't understand the question...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
pld51Author Commented:
Sorry, my question wasn't clear enough it seems. The form itself is not a problem, adding extra lines dynamically was my problem. mplungjan's solution looks like a good answer, using jquery to add another line (=record) to input line by line and then click submit at the vey end.

I am trying out the second link given by mplungjan.
0
 
Gurvinder Pal SinghCommented:
<<Sorry, my question wasn't clear enough it seems.>>
You simply had to write, how to add the form elements row dynamically

I think you are looking something like this
http://www.mredkj.com/tutorials/tableaddrow.html
this is also good
http://www.java2s.com/Code/JavaScript/HTML/InsertingRemovingRowElements.htm
0
 
pld51Author Commented:
<<You simply had to write, how to add the form elements row dynamically >>
Yes, put like that it is quite clear.

To insert each record into the SQL table I presumably need to loop. As all the methods above will take some setting up, any idea which method likely to be easiest to loop through? Or all the same?
0
 
Michel PlungjanIT ExpertCommented:
I suggest jQuery because it is almost defacto standard. Gurvinder's link is from 2001 so almost 10 years old. jQuery will work on all modern browsers
0
 
pld51Author Commented:
Thanks, and sorry for delay
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now