Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
Disable HTML datepicker with calendar icon using jquery

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

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

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()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!