Hello all,
I am making a form in which I need a box of text to show at the top as a reminder with a button to hide it. The way the form works now the box is hidden initially and clicking the button makes it appear. What I want is for it to show initially and when the user clicks the button it disappears. I basically need it to do the opposite of what it's doing.
Here is the code I have behind the button click:
if (testv.rawValue == "1")
{
_checklist.setInstances(0);
this.resolveNode("caption.value.#text").value = "Click to Hide Note";
testv.rawValue = "0";
}
else {
_checklist.setInstances(1);
this.resolveNode("caption.value.#text").value = "Show Note"; testv.rawValue = "1";
}
I have tried switching all the value to the opposite of what they are as well as switching certain ones and keeping some the same. It never works the way I need it.
Can anyone tell me what I'm doing wrong?
Forgive me if I didn't explain this well, I am new to Javascript and Adobe Designer but these forums
have taught me a lot.
Thanks in advance
----- Form.body.Reminder.button.notebutton::initialize - (JavaScript, client) ----------------------
if (notebutton.rawValue == false)
{Checklist.text.presence = "visible"
this.resolveNode("caption.value.#text").value = "Click box to fill out the Med Rec Approval Form."
}
else
{Checklist.text.presence = "hidden"
this.resolveNode("caption.value.#text").value = "Click box to show reminder"
}
----- Form.body.Reminder.button.notebutton::mouseUp - (JavaScript, client) -------------------------
if (notebutton.rawValue == false)
{Checklist.text.presence = "visible"
this.resolveNode("caption.value.#text").value = "Click box to hide reminder"
}
else
{Checklist.text.presence = "hidden"
this.resolveNode("caption.value.#text").value = "Click box to show reminder"
}
For some reason my original code using setInstances wasn't working so I switched it to the presence function. This got it to show when the form is first opened. I then came across another
problem. I wanted the document to save the state of the checkbox so that if it was checked and the document saved, then upon opening it later the text box would be hidden. Through many searches through these valuable forums(thanks Thomp!), I came across a hint to use code in the initialize event to accomplish this. For a while I had initialize sequence in the docReady event so it wasn't working the way I wanted.
Thanks again to all!
BTW, I am using Adobe Designer 7.0.