johnhardy
asked on
check boxes will not show correct state
Hello
I have some tick boxes in an update form eg
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1">
When the tick box is ticked on the form and an update is carried out the record in the access database shows the tick correctly.
However the tick does not show in the checkbox on the form, so if another update is carried out the record is updated again and the tick in the yes/no field disappears.
Is there a way I can get the tick boxes to show on the form when the field is marked 1 ie (ticked)
I have asked this question before but it is still a problem.
Thanks
John
I have some tick boxes in an update form eg
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1">
When the tick box is ticked on the form and an update is carried out the record in the access database shows the tick correctly.
However the tick does not show in the checkbox on the form, so if another update is carried out the record is updated again and the tick in the yes/no field disappears.
Is there a way I can get the tick boxes to show on the form when the field is marked 1 ie (ticked)
I have asked this question before but it is still a problem.
Thanks
John
ASKER
Thanks for that, I am using .asp
Can you help me with .asp ?
Can you help me with .asp ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
<td><input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1" <%if LoggedIn("UserBooksChartse tc") = 1 then response.write("checked") end if
%>></td>
This seems to be whats required but the tick is not showing in the box.
It is in the record OK
<td><input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1" <%if LoggedIn("UserBooksChartse
%>></td>
This seems to be whats required but the tick is not showing in the box.
It is in the record OK
it seems that we are not able to match the value in the db correctly, what do you save in the db if the checkbox is ticked?
ASKER
Thanks
Sorry for the delay.
My server is out of action so I am not getting emails
In access the yes/no files shows as a tick, if I export to a txt file the field shows as 1 and 0
Sorry for the delay.
My server is out of action so I am not getting emails
In access the yes/no files shows as a tick, if I export to a txt file the field shows as 1 and 0
ASKER
I am working in Dreamweaver
I notice the the server behaviour has a red exclamation mark against it which if I try to open I received the message "Before using the server behaviour please creat a recordset"
The recordset is there correctly named and works for all the text fields.
Is this an indication of where things are wrong?
I notice the the server behaviour has a red exclamation mark against it which if I try to open I received the message "Before using the server behaviour please creat a recordset"
The recordset is there correctly named and works for all the text fields.
Is this an indication of where things are wrong?
ASKER
I changed this
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1"<% if rs("tickbox") = 1 then
response.write("checked")
end if
%>>
To
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1"<% if rs("tickbox") = True then
response.write("checked")
end if
%>>
and it seems to be working OK
Does that make sense?
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1"<% if rs("tickbox") = 1 then
response.write("checked")
end if
%>>
To
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1"<% if rs("tickbox") = True then
response.write("checked")
end if
%>>
and it seems to be working OK
Does that make sense?
well then the stored value in db was True or False :]
ASKER
It definitely shows yes/no in the access design view
ASKER
Thanks very much for all the help
your welcome
you can use a code like this(if you are using PHP)
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1"<?php if($row[tickbox]==1) {echo 'checked';}?>>
shortly your HTML should look like the following if record in database is ticked
<input name="UserBooks-Charts" type="checkbox" id="UserBooks-Charts" value="1" checked>