Master Posted May 13, 2016 Report Share Posted May 13, 2016 I have a search form with three level cascading: Type: dropdown (Public, Private, Charter) District:Cascade on Type School: Cascade on District If user select Public next to Cascading is available, otherwise School should be filtered by Type not School. How can I achieve this? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted May 13, 2016 Report Share Posted May 13, 2016 You need to have your search with the following elements: Type: Dropdown HTML Block 1 Code in HTML Block 1: <table id="dis" style="display:none;"><tr><td> Virtula1: district cascade on type Virtual2: school cascade on district HTML Block 2 Code in HTML Block 2: </td></tr></table> <table id="dis2" style="display:none;"><tr><td> Virtual3: school cascade on type HTML Block 3 Code in HTML Block 3: </td></tr></table> <table style="display:none;"><tr><td> District School HTML Block 4 Code in HTML Block 3: </td></tr></table> Add a Footer and use the code below to apply the condition: <script> document.getElementsByName('Value1_1')[0].onblur = function (){ var type= document.getElementsByName('Value1_1')[0].value; if (type == "Public"){ document.getElementById('dis').style.display="Block"; document.getElementById('dis2').style.display="none"; } else { document.getElementById('dis').style.display="none"; document.getElementById('dis2').style.display="Block"; } } document.getElementById("searchID").onmouseover = function (){ var type= document.getElementsByName('Value1_1')[0].value; if (type == "Public"){ document.getElementById("Value8_1").value=document.getElementsByName("cbParamVirtual1")[0].value; document.getElementById("Value9_1").value=document.getElementsByName("cbParamVirtual2")[0].value; } else { document.getElementById("Value8_1").value = ""; document.getElementById("Value9_1").value=document.getElementsByName("cbParamVirtual3")[0].value; } } </script> Quote Link to comment Share on other sites More sharing options...
htamraz Posted May 25, 2016 Report Share Posted May 25, 2016 Hello, I implemented this example, but it's not working for me. I have a good feeling for the overall logic of the code syntax, but not sure what these references below are.. "Value1_1" "SearchID" "Value8_1" "Value9_1" When all is said and done, I would like to have the following done: >>when "Public" is selected: Display the virtual fields Virtual1 and Virtual2. Hide Virtual3 Have "cbParamVirtual1" write to the district field in table Have "cbParamVirtual2" write to the school field in table >>when something other than "Public" is selected: Hide the virtual fields Virtual1 and Virtual2. Show Virtual3 Have "cbParamVirtual3" write to the school field in table Thank you Quote Link to comment Share on other sites More sharing options...
MayMusic Posted May 25, 2016 Report Share Posted May 25, 2016 On search forms IDs are in this format ValueX_Y refer to http://forums.caspio.com/index.php/topic/4377-js-guide-caspio-form-elements/ You can right click on the element and then click on Inspect Element to get the ID Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.