Answers for "disable select box"

3

disable text selection html

<div 
 style="-moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select:none;
        user-select:none;
        -o-user-select:none;"
     
 unselectable="on"
 onselectstart="return false;" 
 onmousedown="return false;">
    Blabla
</div>
Posted by: Guest on August-16-2020
0

Disable input if select option checked

<select id="select">
      <option value="">select this </option>
      <option> 1 </option>
      <option> 2 </option>
      <option> 3 </option>
  </select>
   
  <input disabled type="text" id="p_amount">
  <input disabled type="text" id="pay_full">

$("#select").change(function(){
        if ($(this).val() !== "") {
         $("#p_amount").prop('disabled', false);
         $("#pay_full").prop('disabled', false);
         }
        else {
         $("#p_amount").prop('disabled', true);
         $("#pay_full").prop('disabled', true);
       
       //i means this value of select_option  is empty

        }
  });
Posted by: Guest on October-12-2020

Browse Popular Code Answers by Language