bedbathandbeyonddone Posted May 6, 2013 Report Share Posted May 6, 2013 I am trying to populate one drop down based on multiple dropdown selections before it in virtual fields in javascript. My code looks like this: <script type="text/javascript"> function createIt() { var mke = document.getElementById('EditRecordMake').value; var mdl = document.getElementById('EditRecordModel').value; var ps = document.getElementById('cbParamVirtual1').value; var sys = document.getElementById('cbParamVirtual2').value; var ct = document.getElementById('cbParamVirtual11').value; var bkl = document.getElementById('cbParamVirtual6').value; var key = document.getElementById('cbParamVirtual12').value; var rpm = document.getElementById('cbParamVirtual16').value; var hyd = document.getElementById('cbParamVirtual17').value; var pkbk = document.getElementById('cbParamVirtual13').value; var spd = document.getElementById('cbParamVirtual7').value; var optn = document.getElementById('cbParamVirtual14').value; var wu = document.getElementById('cbParamVirtual4').value; var cc = document.getElementById('cbParamVirtual5').value; var idread = document.getElementById('cbParamVirtual8').value; var mycode = document.getElementsByTagName('select')[17]; var codeval = mke + "_" + ps + "_" + mdl + "_" + sys + ct + bkl + key + rpm + hyd + pkbk + spd + optn + wu + cc + idread; var codetxt = mke + "_" + ps + "_" + mdl + "_" + sys + ct + bkl + key + rpm + hyd + pkbk + spd + optn + wu + cc + idread; mycode.options[0] = new Option(codetxt, codeval, false, true); //mycode.option[mycode.length] = new Option(codetxt, codeval, false, true); } document.getElementById('cbParamVirtual1').onchange = createIt; document.getElementById('cbParamVirtual2').onchange = createIt; document.getElementById('cbParamVirtual11').onchange = createIt; document.getElementById('cbParamVirtual6').onchange = createIt; document.getElementById('cbParamVirtual12').onchange = createIt; document.getElementById('cbParamVirtual16').onchange = createIt; document.getElementById('cbParamVirtual17').onchange = createIt; document.getElementById('cbParamVirtual13').onchange = createIt; document.getElementById('cbParamVirtual7').onchange = createIt; document.getElementById('cbParamVirtual14').onchange = createIt; document.getElementById('cbParamVirtual4').onchange = createIt; document.getElementById('cbParamVirtual15').onchange = createIt; document.getElementById('cbParamVirtual8').onchange = createIt; document.getElementById('EditRecordMake').onchange = createIt; document.getElementById('EditRecordModel').onchange = createIt; </script> It is not working. Could anyone offer any insight as to why please? Anything would be much appreciated! Quote Link to comment Share on other sites More sharing options...
Kurumi Posted August 23, 2021 Report Share Posted August 23, 2021 Hi! Just an update on this, you may use Cascading Elements and Calculated Values on this. For more information, see these links: https://howto.caspio.com/datapages/datapage-components/cascading-elements/https://howto.caspio.com/datapages/datapage-components/calculated-values/ 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.