Jump to content

Recommended Posts

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?

Link to comment
Share on other sites

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>
Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...