Forums

This topic is locked

getting form field value after inserting

Posted 17 Aug 2002 21:00:41
1
has voted
17 Aug 2002 21:00:41 Dave Clarke posted:
hi i'm using asp/javascript (yes i know i need to change to vbscript<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

i have a form that inserts into a table, working fine, but i need to pass the value from one of the form fields to another page after the insert, in the insert behaviour there is a section for "after inserting go to" but you cant pass a form field value through this.
I can do it by setting a session variable to the value of the form field and it works fine but i have been told that it's better to try and restrict usage of session variables so how can i pass this value???

thanks

Dave

Replies

Replied 18 Aug 2002 07:29:05
18 Aug 2002 07:29:05 aegis kleais replied:
This may be an over simplification and all, but since the insert just happened, why can't you just then pull the data on the first page that was inserted into the table now FROM the table itself?

Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Replied 18 Aug 2002 08:06:56
18 Aug 2002 08:06:56 Dave Clarke replied:
thanks aegiskleais

but i dont follow, perhaps i should explain what i'm trying to do more.

what i'm trying to do is when the user inserts their record, after the insert they are taken to a page on which is a recordset which is filtered by one of the fields they just inserted to, so that the page shows all records with that value, because these records might be of interest to them as they contain the same value in the field.
how could i pull this value from the table they just inserted to??
Replied 18 Aug 2002 09:18:43
18 Aug 2002 09:18:43 aegis kleais replied:
I saw this as

tblTableOne
fldUsername
fldPassword
fldWhatILike

and

tblTableTwo
fldWhatTheyLike
fldSuggestThis

So on the first page when you insert your username, password and select what you like, the next page will obtain the WhatILike input and then create a recordset from tableTwo in which where WhatILike = WhatTheyLike, thus then being able to show SuggestThis, etc.

Is this where you're goin?

Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Replied 19 Aug 2002 21:11:24
19 Aug 2002 21:11:24 Dave Clarke replied:
this is sort of where i'm going but without the second table, the form field "whatilike" inserts into fldwhatilike and then on second page a recordset is created where fldwhatilike is filtered by the value of form field whatilike or the fldwhatilike value from the last record added.
even creating another table as you suggest (i think) i would still have to pass the form field value thru the insert. or retrieve the last record added and get the value from that but getting the last record added is a task in itself.

Reply to this topic