February 11th, 2013, 02:00 PM
Form variable parsing problem
I am having real trouble parsing a form variable from page to page and I am beginning to wonder that what I am trying to do might not be possible but I do not see why.
First off I start with a simple page with a dropdown select called CompanyID
This then goes to a page with a SQL select on it with the CompanyID as the selector and lists the results on the listing page. All works fine to this point.
This page also contains an Add submit button with a hidden form field called CompanyID. If the add button is pressed it goes to another page with a form on it with another dropdown selector called CompanyID but since I have parsed the value from the previous page then this is preselected with the parsed CompanyID.
Again all good to this point.
Now this is where I get the problem. If I try and return to the listing page after submitting a form and writing the contents to the database then by vital CompnayID form variable is not coming over so the listing page returns an error.
So to clarify if I just have a drop down selector then parse to the listing page all is well. However it seems if I have an actual submit form then my CompanyID is not getting parsed.
Is there a way to parse the CompanyID back to the listing page as part of an actual form insert/update?
February 11th, 2013, 03:35 PM
it sounds like you problem is after saving record in database in separate page you need to send user back to original listing (send CompanyID).
it could be done a few ways...
I would prefer save your value in session, so in you save page
on list page list.asp
'after saving record
session("CompanyID") = request.form("CompanyID")
session.abandon ' delete session after read value in variable
<option value="1" if CompanyID = "1" then response.write " selected " >company 1</option>
<option value="2" if CompanyID = "2" then response.write " selected ">company 2</option>
<option value="3" if CompanyID = "3" then response.write " selected ">company 3</option>
<option value="4" if CompanyID = "4" then response.write " selected ">company 4</option>
if you found this post is useful click Give Rep button (bottom side on this reply ) and agree
February 21st, 2013, 07:53 PM
simply stopping by to say hello