Master Posted May 10, 2016 Report Share Posted May 10, 2016 How can I enable multi select for multiple lust box on search form I created using submission page? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted May 10, 2016 Report Share Posted May 10, 2016 Values need to be separated by OR on each listbox. Let's say you have 4 virtual listbox: 1, 3, 4 and 5 You need to add 4 more virtual fields to hold the result for each listbox selections. For these we have virtual 6,7,8 and 9. Use the code below in footer. <script type="text/javascript"> var o_els = new Array("cbParamVirtual1", "cbParamVirtual3","cbParamVirtual4","cbParamVirtual5"); for (var j=0;j<o_els.length;j++){ var fieldName = o_els[j]; var x1=document.getElementsByName(fieldName); x1[0].multiple=true; } function splitAndParse() { var o_els = new Array("cbParamVirtual1","cbParamVirtual3","cbParamVirtual4","cbParamVirtual5"); var v_result = new Array("cbParamVirtual6", "cbParamVirtual7","cbParamVirtual8","cbParamVirtual9"); var result = ""; var cleanResult = ""; for (var k=0;k<o_els.length;k++){ result = ""; var fieldName = o_els[k]; var y1=document.getElementsByName(fieldName); for (var i = 0; i < y1[0].length; i++) { if (y1[0].options[i].selected) { result += "\""+y1[0].options[i].value+"\"" + " OR " ; } } if (result.length > 4) { cleanResult = result.substring(0,(result.length-4)); } document.getElementById(v_result[k]).value= cleanResult; y1.value = cleanResult; } } document.getElementById("caspioform").onsubmit=splitAndParse; </script> 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.