SHARE
TWEET

Untitled

a guest Dec 6th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. var SList = new Object();
  3.  
  4.  
  5. var txtsl2 = '';
  6.  
  7.  
  8. SList.slist2 = JSON.parse('{{ Branch|safe }}')
  9. SList.getSelect = function(slist, option) {
  10.   document.getElementById('scontent').innerHTML = '';           // empty option-content
  11.  
  12.   if(SList[slist][option]) {
  13.     // if option from the last Select, add text-content, else, set dropdown list
  14.     if(slist == 'scontent') document.getElementById('scontent').innerHTML = SList[slist][option];
  15.     else if(slist == 'slist2') {
  16.       var addata = '<option>- - -</option>';
  17.       for(var i=0; i<SList[slist][option].length; i++) {
  18.         addata += '<option value="'+SList[slist][option][i]+'">'+SList[slist][option][i]+'</option>';
  19.       }
  20.  
  21.       document.getElementById('slist2').innerHTML = txtsl2+' <select name="slist2" onchange="SList.getSelect(\'scontent\', this.value);">'+addata+'</select>';
  22.     }
  23.   }
  24.   else if(slist == 'slist2') {
  25.     document.getElementById('slist2').innerHTML = '';
  26.   }
  27. }
  28.  
  29. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top