raghup Posted June 15, 2007 Share Posted June 15, 2007 Hi,I am trying to create an update pages in asp using vbscript. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>The update page has checkboxes. How do I make the check in the checkbox visible. I am using the following code.<input name="RecievedNotification" type="checkbox" id="RecievedNotification" value = "<%If RecievedNotification = "-1" Then Response.Write("checked=""checked""") : Response.Write("")%>" />Is this correct? If it is why is the check not visible? If not correct please help.CheersRaghu Link to comment Share on other sites More sharing options...
Yahweh Posted June 17, 2007 Share Posted June 17, 2007 <input name="RecievedNotification" type="checkbox" id="RecievedNotification" value = "<%If RecievedNotification = "-1" Then Response.Write("checked=""checked""") : Response.Write("")%>" />Is this correct? If it is why is the check not visible? If not correct please help.Its not correct, it produces invalid HTML. The resulting HTML will look like this:<input name="RecievedNotification" type="checkbox" id="RecievedNotification" value = "" />or<input name="RecievedNotification" type="checkbox" id="RecievedNotification" value = "checked="checked"" /> That's obviously not right because value and checked are two distinct attributes.You want this instead: <input name="RecievedNotification" type="checkbox" id="RecievedNotification" value="y" <%If RecievedNotification = "-1" Then Response.Write("checked=""checked""") : Response.Write("")%>" /> Link to comment Share on other sites More sharing options...
raghup Posted June 17, 2007 Author Share Posted June 17, 2007 Its not correct, it produces invalid HTML. The resulting HTML will look like this:<input name="RecievedNotification" type="checkbox" id="RecievedNotification" value = "" />or<input name="RecievedNotification" type="checkbox" id="RecievedNotification" value = "checked="checked"" /> That's obviously not right because value and checked are two distinct attributes.You want this instead: <input name="RecievedNotification" type="checkbox" id="RecievedNotification" value="y" <%If RecievedNotification = "-1" Then Response.Write("checked=""checked""") : Response.Write("")%>" /> <input name="RecievedNotification" type="checkbox" id="RecievedNotification" <%If rsCheckLists.Fields.Item("RecievedNotification") = True Then Response.Write("checked=""checked""") : Response.Write("")%> /> works better. Thanks for the tip. I experimented.CheersRaghu Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.