I want to create an Adobe form template for creating references. I want to include category switches which can be "selected" by clicking on them . You can imagine a word formated with grey text font and as soon as you click on it, it turns the font black. The result should be many category possibilities where chosen fields stand out by color.
I partially got my solution by adding a control button field, set the text and format and added Javascript function for releasing mouse button:
getField("Gutachten").textColor = color.black;
This works fine changing the text color from grey to black - but just one dimesional. As soon as you click it the base format of the field gets changed, which is bad in case an employee does not save a copy for the new reference or just simply miss-click... the fields text color stays black.
So I wanted to add a if then statement to change color back and forth between black and grey upon clicking the field. I imagined something like
if (color.equal(("Gutachten").textColor, color.grey)==true) getField("Gutachten").textColor = color.black; else getField("Gutachten").textColor = color.grey;
But it did not work. Maybe the color.equal ain't even the right tool. I found it by searching the Internet for I am mostly a coding noob. ^^ So here I am hoping for help.
Does anybody got an idea how to fix the if then statement?
Kind regards
Aucun commentaire:
Enregistrer un commentaire