Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to disable option after select using jquery

//JS
$("#theSelect").change(function(){          
  var value = $("#theSelect option:selected").val();
  var theDiv = $(".is" + value);

  theDiv.slideDown().removeClass("hidden");
});


$("div a.remove").click(function () {     
  $(this).parent().slideUp(function() { $(this).addClass("hidden"); }); 
});

//HTML
<body>
<div class="selectContainer">
    <select id="theSelect">
        <option value="">- Select -</option>
        <option value="Patient">Patient</option>
        <option value="Physician">Physician</option>
        <option value="Nurse">Nurse</option>
    </select>
</div>
<div class="hidden isPatient">Patient <a href="#" class="remove" rel="Patient">remove</a></div>
<div class="hidden isPhysician">Physician <a href="#" class="remove" rel="Patient">remove</a></div>
<div class="hidden isNurse">Nurse <a href="#" class="remove" rel="Patient">remove</a></div>
</body>​
Comment

how to disable time option in select jquery

$('#fromtime').on('change', function(){
    var totimeValues = [];
    
    var fromTime = $(this).val();

    $('#totime option').filter(function() {
        return $(this).val() <= fromTime;
    }).prop('disabled', true);

    
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: what is download api javascript 
Javascript :: draw diamond in typescript 
Javascript :: bookshelfjs npm 
Javascript :: paamayim nekudotayim 
Javascript :: nodejs api to logged in users count on an application 
Javascript :: JS truthy value of void 
Javascript :: open image in browser fit to screen with window.open 
Javascript :: knockout framework 
Javascript :: guardar en una variable la peticion ajax 
Javascript :: ejs-multiselect 
Javascript :: do nonmetals lose electrons 
Javascript :: await reserved word testcafe using await in loop 
Javascript :: how to calculate each row with on change table <td<input jquery 
Javascript :: capire che giorno della settimana è javascript 
Javascript :: When you run JavaScript in a Node.Js application, elements in a Node.JS Stack actually executes the JavaScript: 
Javascript :: apache log format json 
Javascript :: jquery nested ul li 
Javascript :: jquery dialog button text set by variable 
Javascript :: how to draw flower petals around circle javascript 
Javascript :: change items per page pagination angularjs 
Javascript :: how to make color squares in angular 
Javascript :: js find place value 
Javascript :: Converting from HttpClient to Native HTTP 
Javascript :: deferred promise testing es6 
Javascript :: how to assign bootstrapswitch using jquery 
Javascript :: remove etag express 
Javascript :: js vanilla detect any input 
Javascript :: js var 
Javascript :: greater than x but less than y es6 
Javascript :: node string to chars with spaces in between 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =