locked
javascript & vbscript RRS feed

  • General discussion

  • Hello,

    I am having trouble getting both functions to work on this tool. I can either have the buttons generate the text in my text generator or the dropdown will only show the necessary buttons. I can't get them to operate the way I need them to. What I need to happen is when an option in the drop down is selected it hides the buttons that are not a selection for that option, then when you click the button it generates the text into the box. Thank you in advance.

    <head>
    <title>FSA DIARY COMMENTS</title>
    <HTA:APPLICATION
    BORDER="thin"
    BORDERSTYLE="normal"
    APPLICATIONNAME="FSA Diary Comment"
    SCROLL="yes"
    SINGLEINSTANCE="yes"
    WINDOWSTATE="normal"
    MAXIMIZEBUTTON="yes">
    MINIMIZEBUTTON="yes">
    </head>

    <script type="text/javascript">
    function ChangeDropdowns(value){
        if (value==""){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none'; document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';     
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if (value=="forms"){
            document.getElementById('formoption').style.display='block';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none'; document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none'; 
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="bill"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='block';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none'; document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';  
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="aeft"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='block';
            document.getElementById('removeeft').style.display='none'; document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="deft"){ 
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='block';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="vehicle"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='block';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="driver"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='block';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="fee"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='block';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none'; document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

          
         }else if(value=="cnx"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='block';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="rnwrein"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='block';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="contact"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='block';document.getElementById('sfaspan').style.display='none';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="sfa"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='block';document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';

         }else if(value=="payplan"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none'; document.getElementById('payplanspan').style.display='block';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='none';


         }else if(value=="address"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none'; document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='block';document.getElementById('documentspan').style.display='none';

         }else if(value=="reqdoc"){
            document.getElementById('formoption').style.display='none';document.getElementById('billoption').style.display='none';document.getElementById('addeft').style.display='none';
            document.getElementById('removeeft').style.display='none';document.getElementById('vehiclespan').style.display='none';document.getElementById('driverspan').style.display='none';
            document.getElementById('feewaivespan').style.display='none';document.getElementById('cancelspan').style.display='none';document.getElementById('rnwreinspan').style.display='none';
            document.getElementById('contactspan').style.display='none';document.getElementById('sfaspan').style.display='none'; document.getElementById('payplanspan').style.display='none';
            document.getElementById('addressspan').style.display='none';document.getElementById('documentspan').style.display='block';
    }

    }
       
     
    </script>

    <input
    <center>
    <select id="OptionChooser" name="OptionChooser" onchange="ChangeDropdowns(this.value);">
        <option value=""></option>
        <option value="forms">FORMS SUBMITTED</option>
        <option value="bill">BILLING</option>
        <option value="aeft">ADD EFT</option>
        <option value="deft">REMOVE EFT</option>
        <option value="vehicle">VEHICLE</option>
        <option value="driver">DRIVER</option>
        <option value="fee">FEE WAIVE</option>
        <option value="cnx">CANCEL REQUEST</option>
        <option value="rnwrein">RENEWAL/REINSTATE</option>
        <option value="contact">CONTACT</option>
        <option value="sfa">SFA CALLS</option>
        <Option value="payplan">PAY PLAN</option>
        <Option value="address">ADDRESS</option>
        <Option Value="reqdoc">REQUEST DOCUMENTS</option>
     </select>
    </center>

    <center>
    <span id="formoption" >
      <br><br>
      <input id=runbutton  class="button" type="button" value="ASR" name="run_button"  onClick="Button7">&nbsp;&nbsp;&nbsp;
      <input id=runbutton  class="button" type="button" value="CQ" name="run_button"  onClick="Button8">&nbsp;&nbsp;&nbsp;
      <input id=runbutton  class="button" type="button" value="REKEY" name="run_button"  onClick="Button9">&nbsp;&nbsp;&nbsp;
      <input id=runbutton  class="button" type="button" value="LOE" name="run_button"  onClick="Button10">&nbsp;&nbsp;&nbsp;
      <input id=runbutton  class="button" type="button" value="NON URGENT" name="run_button"  onClick="Button11">&nbsp;&nbsp;&nbsp;
      <input id=runbutton  class="button" type="button" value="RETRO" name="run_button"  onClick="Button12">&nbsp;&nbsp;&nbsp;
      <input id=runbutton  class="button" type="button" value="VOID/STOP" name="run_button"  onClick="Button13">&nbsp;&nbsp;&nbsp;
      <input id=runbutton  class="button" type="button" value="DMV" name="run_button"  onClick="Button14">&nbsp;&nbsp;&nbsp;
      <p>
    CHECK NUMBER&nbsp;&nbsp;<input type="text" name="CHECKNUMBER" size="12"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CHECK DATE&nbsp;&nbsp;<input type="text" name="CHKDATE" size="7">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AMOUNT&nbsp;&nbsp;<input type="text" name="AMOUNT" size="7"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TRANS ID&nbsp;&nbsp;<input type="text" name="TRANSID" size="14">
    </center>
    </span>

    <span id ="billoption">
    <center>
    <br><br>
    <input id=runbutton  class="button" type="button" value="AMT DUE" name="run_button"  onClick="Button15">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="RATE" name="run_button"  onClick="Button16">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="MILEAGE" name="run_button"  onClick="Button17">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="REFUND" name="run_button"  onClick="Button18">&nbsp;&nbsp;&nbsp;

    </span>
    <CENTER>


    <span id= "addeft">
    <br><br>
    <input id=runbutton  class="button" type="button" value="AGT ADD" name="run_button"  onClick="Button19">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="INS ADD" name="run_button"  onClick="Button20">&nbsp;&nbsp;&nbsp;
    </span>

    <span id="removeeft">
    <br><br>
    <input id=runbutton  class="button" type="button" value="AGT RMV" name="run_button"  onClick="Button21">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="INS RMV" name="run_button"  onClick="Button22">&nbsp;&nbsp;&nbsp;
    </span>

    <span id= "vehiclespan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="ADD" name="run_button"  onClick="Button23">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="REMOVE" name="run_button"  onClick="Button24">&nbsp;&nbsp;&nbsp
    <input id=runbutton  class="button" type="button" value="REPLACE" name="run_button"  onClick="Button25">&nbsp;&nbsp;&nbsp;
    <p>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VIN NUMBER&nbsp;&nbsp;<input type="text" name="VINNUMBER" size="14">&nbsp;&nbsp;&nbsp;&nbspVEHICLE NUMBER&nbsp;&nbsp;<input type="text" name="VEHICLENUMBER" size="2"> &nbsp;&nbsp;&nbsp;&nbsp;LICENSE PLATE&nbsp;&nbsp;<input type="text" name="LPNUMBER" size="8">&nbsp;&nbsp;&nbsp;&nbspYMM&nbsp;&nbsp;<input type="text" name="YEARMAKEMODEL" size="8">&nbsp;&nbsp;&nbsp
    <br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ANN MILES <input type="text" name="ANNMILES" size="5">&nbsp;&nbsp;&nbsp;&nbsp; BI/PD <input type="text" name="BIPD" size="5"> &nbsp;&nbsp;&nbsp;&nbsp;  COMP/COLL <input type="text" name="COMPCOLL" size="5">&nbsp;&nbsp;&nbsp;&nbsp;TOW <input type="text" name="TOW" size="3">&nbsp;&nbsp;&nbsp;&nbsp;RENTAL <input type="text" name="RENTAL" size="5">
    </span>

    <span id= "driverspan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="ADD" name="run_button"  onClick="Button26">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="REMOVE" name="run_button"  onClick="Button27">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="REPLACE " name="run_button"  onClick="Button28">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="ADD SR22" name="run_button"  onClick="Button29">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="REMOVE SR22" name="run_button"  onClick="Button30">&nbsp;&nbsp;&nbsp;
    <p>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DRIVER NUMBER&nbsp;&nbsp;<input type="text" name="DRIVERNUMBER" size="1"> DRIVER NAME&nbsp;&nbsp;<input type="text" name="DRIVERNAME" size="14"> DOB:<input type="text" name="DATEOFBIRTH" size="10"> DL#:&nbsp;&nbsp;<input type="text" name="DRIVERSLICENSENUMBER" size="10"> YLV:&nbsp;&nbsp;<input type="text" name="YLV" size="1"> ITV&nbsp;&nbsp;:<input type="text" name="ITV" size="1">
    </span>


    <span id= "feewaivespan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="NSF APPROVED" name="run_button"  onClick="Button31">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="NSF DECLINED" name="run_button"  onClick="Button32">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="PDF APPROVED" name="run_button"  onClick="Button33">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="PDF DECLINED" name="run_button"  onClick="Button34">&nbsp;&nbsp;&nbsp;
    </span>

    <span id= "cancelspan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="AGT CNX" name="run_button"  onClick="Button35">
    <input id=runbutton  class="button" type="button" value="INS CNX" name="run_button"  onClick="Button36">
    </span>

    <span id= "rnwreinspan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="NONRNWL" name="run_button"  onClick="Button37">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="REIN" name="run_button"  onClick="Button38">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="REIN LPS" name="run_button"  onClick="Button39">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="RNWL" name="run_button"  onClick="Button40">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="RNWL LPS" name="run_button"  onClick="Button41">&nbsp;&nbsp;&nbsp;
    </span>

    <span id= "contactspan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="FAX" name="run_button"  onClick="Button42">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="EMAIL" name="run_button"  onClick="Button43">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="BILL FAX" name="run_button"  onClick="Button44">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="BILL EMAIL" name="run_button"  onClick="Button45">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="SFA" name="run_button"  onClick="Button46">&nbsp;&nbsp;&nbsp;
    </span>

    <span id= "sfaspan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="DECLINED" name="run_button"  onClick="Button47">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="APPROVED" name="run_button"  onClick="Button48">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="RECEIVED" name="run_button"  onClick="Button49">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="UNLOCKED" name="run_button"  onClick="Button50">&nbsp;&nbsp;&nbsp;
    </span>

    <span id="payplanspan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="D5" name="run_button"  onClick="Button51">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="DB" name="run_button"  onClick="Button52">&nbsp;&nbsp;&nbsp;
    </span>

    <span id="addressspan">
    <center>
    <br><br>
    <input id=runbutton  class="button" type="button" value="CHANGE" name="run_button"  onClick="Button53">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="ADD LP/AI" name="run_button"  onClick="Button54">&nbsp;&nbsp;&nbsp;
    </center>
    <br><br>
    <center>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ADDRESS: STREET &nbsp;&nbsp;<input type="text" name="STREET" size="14">&nbsp;&nbsp; CITY&nbsp;&nbsp; <input type="text" name="CITY" size="14"> &nbsp;&nbsp;STATE &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="STATE" size="2"> &nbsp;&nbsp;ZIP&nbsp;&nbsp; &nbsp;&nbsp;<input type="text" name="ZIPCODE" size="14">
    </center>
    </span>

    <span id="documentspan">
    <br><br>
    <input id=runbutton  class="button" type="button" value="ID CARDS" name="run_button"  onClick="Button55">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="DEC PAGE" name="run_button"  onClick="Button56">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="RENEWAL" name="run_button"  onClick="Button57">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="UW LETTER" name="run_button"  onClick="Button58">&nbsp;&nbsp;&nbsp;
    <input id=runbutton  class="button" type="button" value="PYMT/BILL" name="run_button"  onClick="Button59">&nbsp;&nbsp;&nbsp;
    </span>

    • Changed type Bill_Stewart Tuesday, November 21, 2017 6:53 PM
    • Moved by Bill_Stewart Tuesday, November 21, 2017 6:53 PM This is not "fix/debug/rewrite my script for me" forum
    Thursday, July 6, 2017 8:10 PM

All replies