gianitoo
asked on
Invalid use of Null: 'CStr'
get this error when my checkbox is empty. how can i change code
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'CStr'
/accountpropertyinfo.asp, line 123
<input <%If (CStr((Recordset1.Fields.I tem("Close stBase").V alue)) = CStr("1")) Then Response.Write("checked") : Response.Write("")%> name="single" type="checkbox" id="single" value="1">
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'CStr'
/accountpropertyinfo.asp, line 123
<input <%If (CStr((Recordset1.Fields.I
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try:
<% IF NOT IsNull Recordset1("ClosestBase") THEN%>
<input <%If (CStr((Recordset1.Fields.I tem("Close stBase").V alue)) = CStr("1")) Then Response.Write("checked") : Response.Write("")%> name="single" type="checkbox" id="single" value="1">
<%End IF%>
There are more elegant ways of doing it, but that should get you going.
bvinson
<% IF NOT IsNull Recordset1("ClosestBase") THEN%>
<input <%If (CStr((Recordset1.Fields.I
<%End IF%>
There are more elegant ways of doing it, but that should get you going.
bvinson
As I said, there are more elegant ways, and I think amit_g probably has one of the more elegant methods. I would, however suggest that in his page you put the function before the code that calls it rather than just "somewhere". Sometimes ASP will stumble if you call a function before its loaded, especially if you don't have response.buffer = true.
bvinson
bvinson
Thank you [amit_g]
Your code would out great for me this evening.
have a good one.
Carrzkiss
Your code would out great for me this evening.
have a good one.
Carrzkiss
If (CStr((Recordset1.Fields.I
<%
end if %>