Last active
August 17, 2017 03:25
-
-
Save samirbehara-zz/f8754349e65f6dc71a192e9f4a4fa538 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<select id="switch"> | |
<option value="unknown">Select Option...</option> | |
<option value="invNumber">Invoice Number </option> | |
<option value="subCode">Subscriber Code </option> | |
</select> | |
<br><br> | |
<span id="invNumber-input" style="display:none"><input type="text" id="name"></span> | |
<span id="subCode-dropdown" style="display:none"> | |
<select id="subCode"> | |
<option>Select SubCode</option> | |
<option>AA</option> | |
<option>BB</option> | |
<option>CC</option> | |
</select></span> | |
===================================================================================== | |
$("#switch").change(function () { | |
switch($("#switch").val()) { | |
case "invNumber": | |
$("#invNumber-input").css("display", "inline") | |
$("#subCode-dropdown").css("display", "none") | |
break | |
case "subCode": | |
$("#invNumber-input").css("display", "none") | |
$("#subCode-dropdown").css("display", "inline") | |
break | |
default: | |
$("#subCode-dropdown").css("display", "none") | |
$("#invNumber-input").css("display", "none") | |
} | |
}) | |
======================================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment