Question
Checkboxes - invalid use of CStr?
What is wrong with this for a radio group? My field
"vatregistered" is an
INT field in a SQL database and I'm using ASP/VBScript.
<input <%If (CStr((rsDetails.Fields.Item("vatregistered").Value)) =
CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%>
name="vatregistered" type="radio" value="1" />
Yes
<input <%If (CStr((rsDetails.Fields.Item("vatregistered").Value)) =
CStr("0")) Then Response.Write("checked=""checked""") : Response.Write("")%>
name="vatregistered" type="radio" value="0" checked="checked" />
No
This produces the following error:
Error Type:
Microsoft VBScript runtime (0x800A005E)
Invalid use of Null: 'CStr'
What gives? I just used the DW wizard to create this, so I'm puzzled.
Thanks again.
Regards
Nath.
INT field in a SQL database and I'm using ASP/VBScript.
<input <%If (CStr((rsDetails.Fields.Item("vatregistered").Value)) =
CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%>
name="vatregistered" type="radio" value="1" />
Yes
<input <%If (CStr((rsDetails.Fields.Item("vatregistered").Value)) =
CStr("0")) Then Response.Write("checked=""checked""") : Response.Write("")%>
name="vatregistered" type="radio" value="0" checked="checked" />
No
This produces the following error:
Error Type:
Microsoft VBScript runtime (0x800A005E)
Invalid use of Null: 'CStr'
What gives? I just used the DW wizard to create this, so I'm puzzled.
Thanks again.
Regards
Nath.
