Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Showing and hiding multiple tables with a drop down list

$
0
0

I am trying to make a drop down list so that users can select the number of tables that are shown/generated when they specify how many tables they need to fill out (there is 1 table to fill out for each day of a multi=day event, max of 5).

 

I thought I would use a similar javascript as the one I used in another place onthe form which was applied to radio buttons for showing or hiding a specific table. When I applied this to the drop down and added more lines the scipt was not working, with some playing around I got it to work, but now it seems thre is an issue with which value is being selected in the list. When a user selects a certain value, it shows the previous value (so when I selected 4 days, which has a velue of "3", the message box I added for testing purposed is telling me I selected value "2"). 

 

I am just wondering if there is an easier way to do the function i am trying to do, or if drop down is the best solution? The max number of tables that can be filled out is 5, so the drop down seems like an ideal way of resticting that for the person filling out the form.

 

This is an exmaple of the script I have applied to the drop down, as a "change" action. It's repeated 4 times for each value.

 

form1.Page2.DropDownList1::change - (JavaScript, client)

 

if (this.value == "2") {

form1.Page2.TableDay1.presence = "visible";

form1.Page2.TableDay2.presence = "visible";

form1.Page2.TableDay3.presence = "hidden";

form1.Page3.TableDay4.presence = "hidden";

form1.Page3.TableDay5.presence = "hidden"; 

}

else {

form1.Page2.TableDay1.presence = "hidden";

form1.Page2.TableDay2.presence = "hidden";

form1.Page2.TableDay3.presence = "hidden";

form1.Page3.TableDay4.presence = "hidden";

form1.Page3.TableDay5.presence = "hidden";

}

 

 

if (this.value == "3") {

form1.Page2.TableDay1.presence = "visible";

form1.Page2.TableDay2.presence = "visible";

form1.Page2.TableDay3.presence = "visible";

form1.Page3.TableDay4.presence = "hidden";

form1.Page3.TableDay5.presence = "hidden"; 

}

else {

form1.Page2.TableDay1.presence = "hidden";

form1.Page2.TableDay2.presence = "hidden";

form1.Page2.TableDay3.presence = "hidden";

form1.Page3.TableDay4.presence = "hidden";

form1.Page3.TableDay5.presence = "hidden";

}

 

I've looked it over and tried a few different things, and my coworker who is much better than me with sciprting is also at a loss at the moment - he isn't familiar with LiveCycle, less than I so any help is appreciated. Many thanks again as my last issue (the script for the radio buttons) was solved on here. Thanks again.


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>