Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing a querystring using VBScript HELP!!!

Status
Not open for further replies.

LongFeiFengWu

Technical User
Nov 9, 2001
98
US
The following set of scripts is used to pass information from a dropdown box to another ASP page in a querystring. For some reason, the values are not being carried to the next page and I can't figure out why. Any help will be greatly appreciated.

<script language="VBScript">

sub B1_onclick()

Name1 = theform.VZID.options(theform.VZID.selectedindex).text

VZID1 = theform.VZID.options(theform.VZID.selectedindex).value

location.href = "reviewsave.asp?Name="& Name1 &"&VZID="& VZID1 &""

end sub

</script>

<body>

<form method="POST" name="theform">
<table border="1" width="100%" cellspacing="0">
<tr>
<td width="23%" align="center"><select size="1" name="VZID">
<option value="NULL">Choose an Employee</option>
<%

SUPID1 = request.cookies("ECT")("SUPID")

SQL = "SELECT * FROM [Emp Data] "
SQL = SQL & "WHERE Status = 'Associate' "
SQL = SQL & "AND SUPID = '"& SUPID1 &"' "
SQL = SQL & "ORDER BY LastName"

objrec.open SQL,objcon,3,3

do while not objrec.eof

response.write "<option value='" & objrec("VZID") & "'>" & objrec("FirstName") & " " & objrec("LastName") & "</option>"

objrec.movenext
loop

'response.write SQL

%>

&quot;If nothing within you stays rigid, outward things will disclose themselves. Moving, be like water. Still, be like a mirror. Respond like an echo.&quot; ~ Bruce Lee
 
Maybe you're not getting the value from the drop down list. Try troubleshooting with an alert.

<script language="VBScript">

sub B1_onclick()

Name1 = theform.VZID.options(theform.VZID.selectedindex).text

VZID1 = theform.VZID.options(theform.VZID.selectedindex).value

alert(Name1)
alert(VZID1)

location.href = "reviewsave.asp?Name="& Name1 &"&VZID="& VZID1 &""

end sub

</script>

See what comes up in the alert window. What is the reference to theform. Is that the name of the form or are you passing reference to your sub. If so, it doesn't look like your sub is passing the form reference to your methods.

sub B1_onclick(?)

Just a thought.

ToddWW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top