0

I have the following UI,

I've set when dropdown select "None" Date From and Date To pickers are disabled, but still calender icon is clickable this is the issue

enter image description here

when dropdown select "Other" Date From and Date To pickers are enabled, in correct behaviour

enter image description here

for this, the code snippet is like this

<td>
  <%: Html.DateTimeTextBoxFor(m=>m.DateFrom, "dd/MM/yyyy", new { showpicker = true }) %>
</td>
<td>
  <%: Html.DateTimeTextBoxFor(m=>m.DateTo, "dd/MM/yyyy", new { showpicker = true }) %>
</td>

script portion

function DropDownChange(isShow)
{
    if(isShow)
    {
     $('#DateFrom').removeAttr('disabled');
     $('#DateTo').removeAttr('disabled');
    }
    else
    {
     $('#DateFrom').attr('disabled', 'disabled');
     $('#DateTo').attr('disabled', 'disabled');   
     $('#DateFrom').val('');
     $('#DateTo').val('');  
    }
}

I'm trying to hide calender icon or disable the onclick action for this calender button from this

kez
  • 2,273
  • 9
  • 64
  • 123

1 Answers1

0

You can try this, it will set showpicker's value to false

$("#DateFrom").attr('showpicker', false);

OR try to hide the textbox itself

$("#DateFrom").hide()
HarrY
  • 607
  • 4
  • 14