Forums
This topic is locked
Checkboxes
Posted 19 Oct 2005 17:16:21
1
has voted
19 Oct 2005 17:16:21 kirsty burgoine posted:
I have in a password protected area a table that shows the details of everybody that has signed up to recieve one of our product brochures and it all works fine. However, to this table I wanted to add a checkbox that I could tick when the brochure has been sent out.Below is my code for the checkbox:
<form action="<%=MM_editAction%>" method="POST" name="FormSentBrochure" id="FormSentBrochure">
<input name="cbSent" type="checkbox" id="cbSent" value="checkbox" <%If (CStr((rsBrochureRequest.Fields.Item("Sent".Value)) = CStr("Y") Then Response.Write("checked" : Response.Write(""%>>
<input type="hidden" name="MM_update" value="FormSentBrochure">
<input type="hidden" name="MM_recordId" value="<%= rsBrochureRequest.Fields.Item("ID".Value %>">
</form>
This makes sense to me. I want the check box to update the database so that its been saved that a brochure has been sent out and I want the check box to always display this. Essentially so that I know who I have to send brochures to.
Unfortunately when I test it the page displays with the persons details but where the checkbox should be I get this error message:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'CStr'
/ExtraPages/ViewBrochureRequests.asp, line 528
Through testing I know this error refers to where I have made the check box dynamic to display a tick if the database says yes but I don't seem to be able to resolve it.
Is there a better way to achieve this?
Thanks
Kirsty <font face='Tahoma'></font id='Tahoma'>
Kirsty
Replies
Replied 06 Nov 2005 23:18:16
06 Nov 2005 23:18:16 Andrew Shanks replied:
Hi Kirsty,
I'm a bit of a newbie and just dabbling in the murky waters of dynamic web design in dreamweaver myself, ...but I had this problem just yesterday, and what I found was that the null error was due to there being no data in that field in my database, ...when the checkbox was having a look at it (to dynamically set whether it was checked or unchecked), it didn't find a Y or N, there was nothing there. The fix was to load the database I had into access and just fill the cells with a whole pile of N's. That fixed it for me, and was fine for what I was doing (as all values had to be unchecked to start with on those database items.
Hope that makes some sense and is some help.
Goodluck!
Andrew
<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
I'm a bit of a newbie and just dabbling in the murky waters of dynamic web design in dreamweaver myself, ...but I had this problem just yesterday, and what I found was that the null error was due to there being no data in that field in my database, ...when the checkbox was having a look at it (to dynamically set whether it was checked or unchecked), it didn't find a Y or N, there was nothing there. The fix was to load the database I had into access and just fill the cells with a whole pile of N's. That fixed it for me, and was fine for what I was doing (as all values had to be unchecked to start with on those database items.
Hope that makes some sense and is some help.
Goodluck!
Andrew
<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 07 Nov 2005 12:09:40
07 Nov 2005 12:09:40 kirsty burgoine replied:
Hi Andrew,
Thanks for the tip. That was exactly what the problem was and it all works now.
Cheers Muchly
Thanks for the tip. That was exactly what the problem was and it all works now.
Cheers Muchly
Replied 07 Nov 2005 20:31:22
07 Nov 2005 20:31:22 Dave Thomas replied:
u can set the Yes/no 1/0 True/False value as a default value in the database table, so you don't have to add them all yourself.
regards
Dave Thomas
<b>DMX Zone Manager</b>
regards
Dave Thomas
<b>DMX Zone Manager</b>