Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-23
9
Medium Priority
?
485 Views
Last Modified: 2012-05-10
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
Comment
Question by:pld51
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 18

Accepted Solution

by:
mgfranz earned 1000 total points
ID: 33743751
<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
 
LVL 40

Assisted Solution

by:Gurvinder Pal Singh
Gurvinder Pal Singh earned 1000 total points
ID: 33743756
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
 
LVL 18

Expert Comment

by:mgfranz
ID: 33743767
Or maybe I don't understand the question...
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

Author Comment

by:pld51
ID: 33745050
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
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33745088
<<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
 

Author Comment

by:pld51
ID: 33745171
<<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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 33747929
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
 

Author Closing Comment

by:pld51
ID: 33856842
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question