This topic is locked

checkbox values

10/3/2005 6:21:08 PM
ASPRunnerPro General questions
author

I had a question awhile ago about changing the value of the checkboxes. For some reason when I did the change you told me to do the checkboxes no longer function correctly. I went in and made the following changes
if Field.Value = "True" or CLng(Field.Value)<>0 then

GetData = "Yes"

else

GetData = "No"

end if
Replace Yes and No with Passed and Failed. This is it.
if Field.Value = "True" or CLng(Field.Value)<>0 then

GetData = "Passed"

else

GetData = "Failed"

end if
When I do this for some reason in the edit pages the checkboxes wont be checked when they are suppose to be. For example I'll go in and edit or add a page and put a check on some fields. When I click submit everythign is fine but if I want to go in and re-edit the page the checkboxes will not be checked and when I hit submit it overwrites everything back to as if nothing we checked before. If i change the code back to how it was originally then everything works fine again.

Sergey Kornilov admin 10/3/2005

Probably the best place to replace Yes and No is the list page itself (Sub LoopRs).
In this case Edit and Add pages functionality will be left intact.

500331 10/6/2005

sorry but can you be a bit more specific on how I go about doing this?
Thanks

Sergey Kornilov admin 10/6/2005

This code is located in Sub LoopRS. See my changes in bold:

strData = GetData(rs.Fields("YourFieldName"), "")



if strData="Yes" then

  strData = "Passed"

else

  strData = "Failed"

end if


Response.Write ProcessLargeText(strData)

500332 10/6/2005

thanks!!