ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 24th, 2003, 10:05 PM
shalee shalee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 shalee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passing value from one form to another form

i have a registration form where the student must enter their personal info(will be inserted in a personal_info table)then the student have 2 proceed and fill up the next form by entering what subjects he would like 2 take....now the problem is i dont know how to retrieve the identity number that has been entered in the previous form(personal info) to be inserted in the subject table...plz help...

Reply With Quote
  #2  
Old August 24th, 2003, 10:10 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
sure you do, how are you having the user select the primary key? Is it automatically assigned? are you using their name? Whatever you set the value to be you just say request.form("name of input") or request.querystring("name of input") depending if you do a POST or GET respectively.

if you're doing an autoincrementing number, well, i've never thought of a better way then quering the database with the request.form(variables) and getting from the previous page, and the most recent row (should only be one if it's truly a primary key....) is your user entered data. If anyone else can think of a way for autoincrementing numbers i'd like to hear it...

Reply With Quote
  #3  
Old August 25th, 2003, 07:37 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
My understanding is that ther user fills in FORM#1
Then you make an INSERT into a TABLE.
What you need is the UNIQUEID of the record you've just INSERTED right?

Then as you're sending the user to fill in FORM#2 you need to pass that UNIQUEID that you've just received.

To do that, you'll want to look into @@IDENTITY and there is another one which I forgot that's better then @@IDENTITY but...anyway read this:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79


Hope this helps!
Sincerely

Vlince

Reply With Quote
  #4  
Old August 25th, 2003, 08:02 PM
shalee shalee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 shalee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
the identity number which i meant here is the user's identity card number.....

Reply With Quote
  #5  
Old August 25th, 2003, 11:38 PM
DaronTan DaronTan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Malaysia
Posts: 49 DaronTan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 23 sec
Reputation Power: 5
Send a message via AIM to DaronTan Send a message via MSN to DaronTan Send a message via Yahoo to DaronTan
How bout this

sure you must have used this method

<%
Dim strCardID
strCardID = Request.Form("txtCardID")
%>

Then on the other page you can retrieve the CardID like this

<input name="txtCardID2" type="text" value="<%=strCardID%>">

Hope it helps

Reply With Quote
  #6  
Old August 26th, 2003, 12:06 AM
shalee shalee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 shalee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks a lot......

Reply With Quote
  #7  
Old August 26th, 2003, 12:13 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Quote:
the identity number which i meant here is the user's identity card number.....

If you need help, this is a terrible way to get it. You need to give us more information

now, once again, are you letting the user pick the number or is it an autoincrementing number or being assigned by some other method?

if you are letting the user pick the value you can do what i said earlier, or what darontan was so nice as to reiterate. If not, how did you insert the last record was it an autoincrementing column? random generator? can you uniquely identify this column? Vlince's method is fantastic if you can lock the database, however this is a terrible solution if you can't for obvious reasons

a way around this is if you can uniquely identify this column with given information (and i hope you should), then you should do another query to select that row. Are you grabbing name and address? I don't think people with the same name and address enter a query within 10 milliseconds of each other? What's the level of security and data integrity of this site?

"also darontan's method" only works with a POST method, you'll need request.querystring if you're doing a GET. Also are you doing this in VBscript? If you need Javascript send out another message.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Passing value from one form to another form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway