Forums
This topic is locked
Insert multiple records ASP/JavaScript
Posted 27 Jan 2005 03:19:28
1
has voted
27 Jan 2005 03:19:28 Chad Choban posted:
Ok, I can actually make DW sing, but I'm not really the best coder. The subject tells you my end goal of inserting multiple records at the same time, but let me tell you what I have done so far. I am creating a system to keep track of backup jobs and the backup tapes associated with each job. By the time the user gets to the "Page one" listed below, the backup record has been created, and now I want the user to be able to tell me how many tapes were associated with the job, then fill out a form, listing each tape ID separately, and then insert each row of that form into the DB as a unique record, (with MS SQL Server simply assigning an ID to it automatically). No, I do not need those unique ID's returned on the confirmation page. Here is what I have done so far:Page one creates two things; 1) A user-entered number, and; 2) A backup job ID.
Page two has a form built into it, with JavaScript code that assembles two fields per row; 1) a hidden field which contains the backup job ID (which will associate this child record to the master in a different table), and; 2) a simple text field named "TapeNbrXX", where "XX" is actually a unique number. The script "ticks" on as many numbered field rows to this form as requested, based on the number the user entered on page one.
OK, just to be clear, I have this form, that kind of acts like a repeat reagion based on the number that the user entered on page one. (IT IS NOT ACTUALLY A REPEAT REGION.) Each row of the form has the field "HiddenXX" with a value set to the backup job ID, and TapeNbrXX, which the user will enter tape numbers into.
I need a piece of code that will insert each row, with numbered fields, and then move onto the next row, until there are no more rows.
God, I really don't know if I even explained this clear enough... Please ask me questions if you don't understand. I can certainly post the code that I have written to create the form, but that is pretty much irrelivant to how I insert the data, isn't it?
Any help would be GREATLY appreciated!!!
Replies
Replied 04 Feb 2005 23:26:25
04 Feb 2005 23:26:25 Chad Choban replied:
I figured this out for anyone who is interested. I have an explaination document, and example pages that I can e-mail off to anyone who asks. Again, I want to state that I am not the best coder, and I try to use as much native DW code as possible, so it may not be the best possible solution, but it works, slick as SH*T.
Chad
Chad
Replied 21 Dec 2006 02:40:56
21 Dec 2006 02:40:56 John Wogick replied:
I would like a copy of those instructions if you could send them to
Thanks!
Thanks!