Solved

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

Posted on 2010-09-23
9
474 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 250 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:gurvinder372
gurvinder372 earned 250 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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 33744055
0
 

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:gurvinder372
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

Industry Leaders: 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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

759 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