Skip to main content
Inspiring
January 27, 2016
Answered

Conditionally display a field

  • January 27, 2016
  • 3 replies
  • 516 views

I would like to show a field based on the value of a user variable set with just a bit of JavaScript. A copy of the field would be included on each question slide in a quiz. The field would contain a reference for the question. So if my user var = 1, the field will appear automatically on each slide where it exists. If my user var is not equal to 1, the field will remain hidden.

I don't seem to be able to associate any actions with a standard field object so does anyone have a suggestion describing how I might go about achieving this behavior?

Must I a use an advanced action on each page? If that is the case, then each page must have its own customized copy of the advanced action to refer to each uniquely named field throughout the quiz. That is my current assumption because I haven't discovered any way to make actions generic so logic in the advanced action would apply an object based on a generic reference to something like "my" or "this".

Thanks,

Pete

This topic has been closed for replies.
Correct answer Pete47

I believe that I have answered this for myself.

Yes, when I mentioned a text field, I was actually referring to a text caption in "Captivate Speak". In my case, I want a unique piece of information stored with each question in a quiz. That piece of information will be the study reference for the question. It will only be visible when a user variable has been set to the value of "1" by a javascript call. That call is triggered by a "backdoor" on the title page. When double-clicked, that transparent button asks for a simple password. If the right password is given, the user var is set to 1.

The answer is to place a copy of the field on each quiz page and use a shared action triggered by the On Enter event for each slide to show the normally hidden field.

3 replies

Pete47AuthorCorrect answer
Inspiring
January 28, 2016

I believe that I have answered this for myself.

Yes, when I mentioned a text field, I was actually referring to a text caption in "Captivate Speak". In my case, I want a unique piece of information stored with each question in a quiz. That piece of information will be the study reference for the question. It will only be visible when a user variable has been set to the value of "1" by a javascript call. That call is triggered by a "backdoor" on the title page. When double-clicked, that transparent button asks for a simple password. If the right password is given, the user var is set to 1.

The answer is to place a copy of the field on each quiz page and use a shared action triggered by the On Enter event for each slide to show the normally hidden field.

Lilybiri
Legend
January 28, 2016

Lot of unnecessary work, but if you are OK with that.... You ignored my tip:

     If it is the same on each slide: time that 'field' (maybe it is a text container?) for the rest of the project, always on top and you are set. At least if this 'field' doesn't change? You cannot put it on a master      slide if you need to control its visibility.


That would mean only one advanced action, and one caption or shape. Too easy, I suppose

Pete47 wrote:

I believe that I have answered this for myself.

Yes, when I mentioned a text field, I was actually referring to a text caption in "Captivate Speak". In my case, I want a unique piece of information stored with each question in a quiz. That piece of information will be the study reference for the question. It will only be visible when a user variable has been set to the value of "1" by a javascript call. That call is triggered by a "backdoor" on the title page. When double-clicked, that transparent button asks for a simple password. If the right password is given, the user var is set to 1.

The answer is to place a copy of the field on each quiz page and use a shared action triggered by the On Enter event for each slide to show the normally hidden field.

TLCMediaDesign
Inspiring
January 27, 2016

When you say field, do you mean a text caption?

Once the variable is 1 would the "field" stay on for the entirety of the quiz?

Lilybiri
Legend
January 27, 2016

I don't know what you mean by 'field', nor what has to be in it if the variable is set to 1 (by JS, based on what?)??? Please give more details.

If it is the same on each slide: time that 'field' (maybe it is a text container?) for the rest of the project, always on top and you are set. At least if this 'field' doesn't change? You cannot put it on a master slide if you need to control its visibility.

I'm sorry but your question is too vague to give you a correct answer, too much missing information. Why 'generic'? Or do you need a shared action?