You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Highlighting Checkboxes in Error?

1 reply [Last post]
Larry's picture
User offline. Last seen 3 years 24 weeks ago. Offline
Joined: 03/18/2008
Posts: 19

I can't recall ever seeing a checkbox highlighted in red as an error. Normally it doesn't happen because it's usually a Yes/No field edit and there's no opportunity for a bad value.

I've got FieldEdit code to check for existence of some separate data when a checkbox is turned on, and throw an error if that data doesn't exist. Problem is, the checkbox doesn't highlight in red, and it stays turned on. I want it to reset to unchecked ('N'), but I can't do that in FieldEdit PC, and it never gets to FieldChange due to the Error I throw. If I can't reset the checkbox, I at least want it to show in red so the user knows it's an error.

Anyone got any ideas?

CompShack's picture
User offline. Last seen 6 years 28 weeks ago. Offline
Joined: 12/09/2007
Posts: 167
Re: Highlighting Checkboxes in Error?

Larry, nice to see you on the forum again. You always come up with these weird requirements!

Have you tried something like forcing the red color in by using CSS PS style?

IF check_box = 'Y' and none(related_text_field) then
      your_record.check_box.Style = "PSERROR";
      MessageBox(0, "", message_set, message_num, "You must enter text when the check box is checked.");
Else
      your_record.check_box.Style = "PSTEXT";
End-If;

I have done this on an a text field but not check box field, so I'm not sure it is going to work. Make sure the messagebox has a severity of "Error".

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog