Expand my Community achievements bar.

Show/hide Dropdownlists

Avatar

Level 1

Hi,

I am rather new at FormCalc and designing PDF forms, I have done some with calculation etc. and I am trying to figure out the right formula for my current project. I am working on a sale form. there are different kinds of buildings, (e.g Playhouse, ValueLine, Lofted Barn) and depending on what type of building, the options are different. So what I would like to have on this form is one dropdownlist to start with, and depending which kind of building is chosen, will make a second dropdownlist available with only the options for that kind of building. For example: Value Line building is chosen, so a second drop down list appears with only the options for Gable or Gambrel roof.

I have been messing with some functions like this:

OptionsList1.presence = "hidden"

if (BldgType == "1")

then OptionsList1.presence = "visible"

elseif (BldgType == "2")

then OptionsList1.presence = "visible"

And so on.

I am sure this is amateur for most of you but I would really appreciate the help!!

Thanks!

4 Replies

Avatar

Level 10

Hi,

A couple of things:

  • You are missing an 'endif' on the last line to close the if statement.
  • The script generally looks good, but if the objects are in different subforms then the reference may not be full enough. When in the script editor you can hover the mouse over the object that you want to reference. Press and hold Control and the mouse will change into a 'V'. Click on the object and LC Designer will insert as full a reference as is needed into your script.
  • Check that you have set the language to FormCalc in the script editor.
  • Check which event you used. For a dropdown I would use the exit event.
  • If the script is in the BldgType object, then I would use 'if ($ == "1")'. $ is equal to the value of the object that the script is in (eg its own value).
  • Check that the form is saved as a Dynamic XML form in the save as dialog.

Hopefully that will get it working. If not can your share the form. Upload it to Acrobat.com and post the published URL here.

Niall

Avatar

Level 1

Thanks for the tips... however I'm still having a few little bugs. I don't have the option for saving as a Dynamic XML, I only have options for Adobe XML  OR a Dynamic PDF. =/ And when I hold ctrl nothing happens =[  And I can get my Drop down to HIDE if i put the OptionsList1.presence = "hidden" on the enter or initialize event, but then when i put the whole formula together on any event it either gives a error msg or doesn't do anything at all.... What am I doing wrong?? I'd really like to get this project finished!! =/

thanks so much for your help!!

Avatar

Level 10

I don't have access to LC Designer, but there are lots of examples on the forum. Just do a search for 'presence' or 'visible'.

Good luck,

Niall

Avatar

Level 1

Thanks so much for your help. I finally was able to get it to work, by saving the file as a Dynamic PDF and using the

if ($ == "1")

then DropDownList2.presence = "hidden"

endif

formula on the first box (mouseExit event) and hiding the second boxes on the initialize event..

Thanks again!!

Emmi