I thought I was on the right path. I have a drop-down with seven options. Here is what I need: If they select RFA (value 4) then "textfield14" becomes visible. If they select any of the other choices then "table5" becomes visible and "textfield14" goes hidden. My current formula is on the right track but if I select RFA and "textfield14" shows but then I choose another option, the "textfield14" does not hide again. Thoughts?
if (DropDownList1==4)then
TextField14.presence = "visible"
elseif (DropDownList1==1 or 2 or 3 or 5 or 6 or 7) then
Table5.presence = "visible"
else TextField14.presence = "hidden"
Table5.presence = "hidden"
endif
Solved! Go to Solution.
Views
Replies
Total Likes
Views
Replies
Total Likes
I wrote this quickly in JavaScript. You can place this code in the exit event of your dropdown box. You need to set the text box and the table properties to hidden before you write the code. For simplicity, I only put 4 values in the drop down box. The || is the "OR" statement in JavaScript. I tested this code and it should work for you.
If you select the first or second selection in the dropdown, the table will appear. If you select the 4th choice, the textbox will appear. If you select the third option, nothing will happen.
if (this.rawValue == "4"){
form1.Page1.TextField4.presence = "visible"
form1.Page1.Table5.presence = "hidden"
}
else if (this.rawValue == "1" || this.rawValue == "2"){
form1.Page1.TextField4.presence = "hidden"
form1.Page1.Table5.presence = "visible"
}
else {
form1.Page1.TextField4.presence = "hidden"
form1.Page1.Table5.presence = "hidden"
}
Views
Replies
Total Likes
I put that in and it did not work. I am thinking because my form has a subform and it's messy. I did try to add in the additional layers to the presence lines but it still didn't work. Take a look at the picture and let me know what you think. Is there not FormCalc for this?
Views
Replies
Total Likes
I developed a test of that code and it worked per your original question. Usually if the code is not working, it is an object reference issues, not a code issue.
Yes, you can do the same thing if you wish to use FormCalc. If you send me the form, or post the form on dropbox, I can put the code in there for you.
Views
Replies
Total Likes
Thank you for your assistance. Let me know if this link doesn't work.
Dropbox - PCS 08 - Procurement Selection Justification with red text.pdf
Views
Replies
Total Likes
I received your form. I did a quick mock-up and included working FormCalc code in your drop box field.
As I surmised, your code actually worked, to a degree. Generally, in hide/display events, you need to include both elements in each if/then condition statement in order to ensure that if a user hits the wrong entry, then corrects, both fields are not visible..
Other items for consideration:
The link for the working code is found here: Dropbox - Untitled1.pdf
Good luck.
Views
Replies
Total Likes
Posted wrong file; use this link:
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies