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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

value not being passed

Status
Not open for further replies.

frogggg

Programmer
Jan 17, 2002
182
0
0
US
I have a page with a listbox. The user selects a value and the next page opens with more information about the selected value. This is my code:
<%
dim varlocation
varlocation = lstLocation.getText()
%>

<!--search button to pass value of variable-->
<a href=&quot;displayJobs.asp?Location=<%=varlocation%>&quot;>Search</a>

This is the error I'm getting:
Data type mismatch in criteria expression.

Also, in the URL, Location= the first value of the listbox instead of the selected one.

What am I doing wrong?
I would appreciate any help.
 
Unless you have me confused again...very possible, especially today, on the second page...assuming the list box is in a form, you can just to request.form(&quot;lstLocation&quot;) and it should get the value of the selected item I believe.

As for why the value that your current code is always the first entry in the list box...I dunno really. Is lstLocation.getText() correct or should it be lstLocation.value??

Hmmm...maybe I just don't know and should shut up and quit replying when I don't know. |-I Sorry for making you read my rambling here, hope someone else knows what's going on. Maybe I should just start my weekend now, it's be a lot easier!!

Mike
 
Mike,
This time it's my fault - I didn't tell you that the listbox is a dtc, and the

varlocation=lstlocation.getText()

is on the same page, because it can't go on a form as you should know from the last post you answered.

btw, getText and getValue are the same unless there is a bound column with an ID as the bound column.

 
You may want to use a session variable...

Session(&quot;varlocation&quot;) = lstLocation.getText()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top