Link to home
Start Free TrialLog in
Avatar of kali958
kali958Flag for United States of America

asked on

Checkbox to display image

I have a contact app I need to make and wanted to be able to select the "prefered method" of contact for a person. For example, I have fields for work phone, cell phone, home phone, alternate phone. I wanted the admin assistant to check a box for the "prefered" contact and then display a gold star image by that phone number.  I did not want to display a value for the checkbox, just that if it is checked, then display star, if not, display nothing.

I am finding that when I create a checkbox with no value, when I go to check the box, the checkmark disappears after I exit the field.

Is there a way to set the checkbox to no value and just display a box to check?
Checkbox-Question.gif
SOLUTION
Avatar of doninja
doninja
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is a good workaround.

Another option is to use no choices for the checkbox, but code an onChange event handler that maintains the actual fields that control whether the image is displayed.  If you code onChange, make sure you also enable the field's 'Run Exiting/OnChange events after value change'.
Avatar of kali958

ASKER

@doninja - that is a "workaround" but when I put in a "dot" or the letter "y" and make the text white, it throws off the alignment of the field and then also shows a box after the checkmark. (See Image).

@Bill - I am willing to try the OnChange, but I am assuming I would have to LotusScript that. So write something that would say "If this box is clicked/checked, then display the gold star, if not, do not display image?"
Would this still retain the checkmark in the checkbox field?
 User generated image
do get a slight box when selecting the box and the alignment can be cured with div or put the box and image in their own table cells.

Bill's solution is a good coded solution rather than my simple workround.

Most people don't even notice the slight box on the page's I have done as they are clicking through it. This can work for users using web browser access as well with no major changes.
Avatar of kali958

ASKER

@doninja - what do you mean by "cured with div" (I get what you mean about cells)
 This is also only for client users, company does not use web :(
RE: So write something that would say "If this box is clicked/checked, then display the gold star, if not, do not display image?"

Notes forms don't work like that.  Instead, you would have a hidden field for each image.  The fields would initially be blank.  When the user clicks on a checkbox, the code would loop through the hidden fields, setting all to blank except the one that controls the image for that field, which would be set to "1".  Then, the hide-when formula behind the image would simply check the controlling hidden field for the value "1".

RE: Would this still retain the checkmark in the checkbox field?

No
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kali958

ASKER

Both will work. I am going to try the coded solution but I am running out of time on this project so may need to go to the first solution.

Thank you both for taking the time to help me understand the solution.