Show/Hide Subform based on drop-down selection that auto populates radio buttons
after selecting drop-down list auto populates 2 different radio buttons. radio button fields should show/hide 2 different subforms. radio button fields populate, can't show/hide function work. below form without show/hide function. https://acrobat.com/#d=zcfwst0l-qekmyia13bh8w below form before got auto populate script written has show/hide. https://acrobat.com/#d=hjsoyihezfcuxor89twx5q can't seem them work together. please help.
hi,
looking @ code have, has few mistakes in causing issues
issue 1
in following line of code checking if rawvalue equal "1", not assigning "1" rawvalue;
ochr4400.design1.request.simandatory.sireq.rawvalue == "1";
code should be
ochr4400.design1.request.simandatory.sireq.rawvalue = "1";
issue 2 ( , might files have uploaded )
case statement not match dropdown list running from
drop down list has values ("books", "business cards", "meeting room reservations", etc........)
testing valies ("location a", "location b", "location c", etc ...........)
if change code case statement works
switch (newval) {
case "books":
simandatory.sireq.rawvalue = "2";
break;
case "business cards":
ochr4400.design1.request.simandatory.sireq.rawvalue = "1";
break;
case "meeting room reservations":
ochr4400.design1.request.simandatory.sireq.rawvalue = "1";
break;
default:
break;}
please note use dropdown list return numbers instead of selected , makes coding easier if need change entry don't need change the code behind it. example, entry "books" changed "text books" mean code not work anymore, more information can found in the livecycle designer help.
issue 3
if assume fixes above have been done rawvalue being set "1", means code have on radio buttons
if (this.rawvalue == "1")
{design1.si.presence = "visible";}
else
{design1.si.presence = "hidden";}
means item design1.si present or not set, work unless user changes mind have no code change radio button yes either not selected or no, means once 1 of items above list selected item show, without knowing full workflow recommend add line the default of case statement change value of radio button "2" , mean value of radio button can changed.
switch looks ( have removed unnesserary parts of path rawvalue of radio button)
switch (newval) {
case "books":
simandatory.sireq.rawvalue = "1";
break;
case "business cards":
simandatory.sireq.rawvalue = "1";
break;
case "meeting room reservations":
simandatory.sireq.rawvalue = "1";
break;
default:
simandatory.sireq.rawvalue = "2";
break;}
now of work still has not made code work because setting value of radio button programatically not firing "change" event , therefore show hide code not being run, need call show hide code ourselves , achieved using following code
simandatory.sireq.execevent("change");
please find attached modified sample of form shows show hide , selction dropdown list working, don;t know how want work have guessed make example.
https://acrobat.com/#d=*gympqhhhnrnk*xujjz-dq
hope helps
malcolm
More discussions in LiveCycle Designer
adobe
Comments
Post a Comment