These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Button toggle

PetafromOz
Registered: Jun 8 2009
Posts: 230
Answered

Hi everyone,

I have a table with around 30 rows. In each are summarised headings. For each row I've created textboxes with detailed help info to explain the purpose of each heading. I've created a Help button for each line so the user can click that button for a detailed explanation of the required line. The 30 Help textboxes belong in a subform called 'Helps'.

I want the button to be a toggle, click it to see the text, click again to switch it off. I know I could do a mouseover, but the lines are so close together that it's a bit annoying to have these help screens flashing on every time you slide the mouse down.

I've tried several ways but to no avail. This is where I am at present & it doesn't work:

if(Helps.MajHazHlp.presence = "hidden");
{
Helps.MajHazHlp.presence = "visible";
}
else
{
Helps.MajHazHlp.presence = "hidden";
}

If I just do the first thing and leave off the 'else' condition, it displays the textbox without a problem. The minute I add the 'else' condition, it doesn't work at all. I assume the problem is that the else condition is throwing it out because it's already hidden to start with, so it's reading that and thinking - well I'm already hidden, so there's nothing to do.

I've also assigned vars to it, tried doing switch cases - none work. I've tried all of these in both the Click and MouseUp events. Can anyone tell me how to create a toggle button for this please?

from way... underground at Parkes - central West NSW - Australia

My Product Information:
LiveCycle Designer, Windows
PetafromOz
Registered: Jun 8 2009
Posts: 230
Bizarre! I just switched this to FormCalc, and it works.

This is what I now have in the Click event using FormCalc:

if(Helps.MajHazHlp.presence == "visible") then

Helps.MajHazHlp.presence = "hidden"

elseif(Helps.MajHazHlp.presence == "hidden") then

Helps.MajHazHlp.presence = "visible"
endif


Solved my own problem, although I'm not too sure why it wouldn't work in JavaScript.

from way... underground at Parkes - central West NSW - Australia

hcorbin
Registered: Aug 11 2009
Posts: 57
Hi Peta,

The JavaScript script is setting the presence to hidden in the If statement.

if(Helps.MajHazHlp.presence = "hidden"); // Should beif(Helps.MajHazHlp.presence == "hidden");

Cheers
Hélène