简体   繁体   中英

input or date-picker disabled box in form

检查状态 RTI 申请 ---------------- 或 ---------------- 提交

Seems like you're doing other way around?

if the input type is empty or null that is where you want to disable the datecalendar is it?

$('#number').keyup(function() {
   if ($(this).val() == '') {
   alert("triggered"); //Placed this to make sure it works.
    $('#calenderdate').prop('disabled', 'disabled');
    $("#calenderdate").removeClass(".datepicker, .gj-textbox-md");
    $('#calenderdate').prop('disabled', true);
   } else {
    $('#calenderdate').prop('disabled', false);
    $('#calenderdate').val('');
   }
 });

If the selected value is false ie ($this.(val() == '') {...} then make the input value as true .

$('#calenderdate').keyup(function() {
      if ($(this).val() == '') {
     $('#number').prop('disabled', true);
    } else {
     $('#number').prop('disabled', false);
    }
  });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM