Cascading Dropdown List

后端 未结 2 2158
天命终不由人
天命终不由人 2021-01-22 00:01

I am working on a web app and trying to code a form with two dropdown lists. The list in the second dropdown will be dependent on the selection from the first one. The task it

2条回答
  •  无人共我
    2021-01-22 00:31

    That's exactly what I did. Below is the javascript function I came up with. OnChange, I call getOptions and the pythonScript creates the second dropdown list. I am able to pass in a parameter to get the data I need for this dropdown. Thanks!

      function getOptions() {
        var code = 'code=' + $("dropdown1").getValue();
        var myAjax = new Ajax.Updater('dropdown2', './pythonScript', { method: 'get', parameters: code });
      }
    

提交回复
热议问题