|
 |
asp_databases thread: I'm baffled
Message #1 by "Arbon Reimer" <arbon_reimer@h...> on Mon, 14 Aug 2000 22:28:50
|
|
I have a char field in my SQL Server database, and I'm trying to set Radio
buttons based on this field's value.
It is Gender... and the two possibilities are M and F.
I can't understand why this code won't work.
<input type="radio" name="gender" value="M" <%if objRS("Gender") = "M"
then%>checked<%end if%>>
If I just use Response.Write objRS("Gender") I get a M on the screen.
I'm baffled... why won't a M and a M compare? I've tried StrComp(),
CStr(), everything! Any suggestions? Thanks in advance.
Message #2 by "Amanda Trieu" <amanda.trieu@b...> on Tue, 15 Aug 2000 08:25:25 -0600
|
|
I had this problem, and what i did was do a trim first.
eg... trim(objRS("Gender"))
-----Original Message-----
From: Arbon Reimer
Sent: August 14, 2000 10:29 PM
To: ASP Databases
Subject: [asp_databases] I'm baffled
I have a char field in my SQL Server database, and I'm trying to set Radio
buttons based on this field's value.
It is Gender... and the two possibilities are M and F.
I can't understand why this code won't work.
<input type="radio" name="gender" value="M" <%if objRS("Gender") = "M"
then%>checked<%end if%>>
If I just use Response.Write objRS("Gender") I get a M on the screen.
I'm baffled... why won't a M and a M compare? I've tried StrComp(),
CStr(), everything! Any suggestions? Thanks in advance.
|
|
 |