Here is another problem that I think is related to quotes. Here, the receiving page only gets the first part of the value (up to the first space, and the rest is truncated). I had a similar problem recently, and it turned out that I was missing some quotes. But I can't find it here. Help again, por favor?
bubba thanks for the try, but that gives me a value of a comma then a space. In the receiving page, I use that value to construct an SQL statement, like this
Code:
mySQL = "Select ROW_ID From Facility_Information Where FAC_NAME = '" & request.form("facility") & "'"
and with your code it comes out
Select ROW_ID From Facility_Information Where FAC_NAME = ', '
You need to play with the code, but using double and sometimes triple double quotes is the way to do it. using the single quotes as dcarlson said works -- but there could be other problem arising out of this if the data contains single quotes.
Guys thanks for all of the help. I tried the double quotes, and it works for the variable value Facility. But for the select box cmbFacility, even with the single, double, or triple quotes it is STILL truncating values... anyone have ANY idea why?!?
Last edited by DrewDog_21; Apr 6th, 2001 at 10:45 AM.
no, I am not sure that it is a quote problem now. And I am about to jump out the damn window since I have been working on this one stupid problem for 3 hours. There are no single quotes anywhere in the select box. And response.write request.form("facility") brings up a blank value now. About an hour ago it at least showed a truncated string, so i seem to be going in the wrong direction...
<%
response.write "<input type='hidden' name='facility'"
response.write " value='"
If IsAdmin = True Then
response.write cmbFacility
Else
response.write Facility
End If
response.write "'>"
%>
For you to have a value for cmdFacility you need to have a default value selected in the box. If nothing is selected when your page loads cmbFacility will be blank.
It returns it from the request command on the page ConfirmCensus.asp And for some reason I can't reference the combo box in AddCensus.asp from the page ConfirmCensus.asp, because it truncates everything after the first space still (see my other post) http://forums.vb-world.net/showthrea...threadid=66402
If IsAdmin = True Then 'user is in administrative group because no facility code was found
response.write "<tr><td>"
response.write "<b>Select Facility: </b></td><td><SELECT NAME='Facility' SIZE=1 DEFAULT=True>"
rsFacility.MoveFirst
Do While Not rsFacility.EOF 'define the ListBox options
response.write "<OPTION VALUE=" & rsFacility("FAC_NAME") & ">" & rsFacility("FAC_NAME")
rsFacility.MoveNext
Loop
response.write "</SELECT></td></tr>"
else
response.write "<input type='hidden' name='facility'"
response.write " value='" & Facility & "'>"
End If
This way the administrator can chose the facility and everyone else is stuck with the hidden value
dcarlson and company, thanks so much for hanging with me here.
For the curious, here was the final solution:
I tried several different methods, including always using a hidden input box, using one only if the user was not an administrator, and using the QueryString. Everything that I tried either did not pass anything or only passed part of the string.
dCarlson's final suggestion worked, save one thing: the line