Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9052321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:08:23+00:00 2026-06-16T13:08:23+00:00

Possible Duplicate: Remove Datepicker Function dynamically In my web application i am using the

  • 0

Possible Duplicate:
Remove Datepicker Function dynamically

In my web application i am using the datepicker. I am using the same page for create and edit the details. While editing the page the date should not be editable. I am disabling the datepicker by using the following code.

$( "#datepicker" ).datepicker("disable");

But the above code also disables the input field also.(If the input field is disabled in edit mode the data is not posted to the PHP). I want to disable the datepicker without disabling the input field and i want to show the “ui-datepicker-trigger” icon. Can anyone help me out.
Following is the link to JSFIDDLE

http://jsfiddle.net/Xppj6/1/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:08:24+00:00Added an answer on June 16, 2026 at 1:08 pm

    Try,

    $( "#datepicker" ).datepicker( "destroy" );
    

    In response to your comment:
    if you want to preserve icon just do it manually, i.e. copy icon from DOM tree, destroy datepicker (this will remove icon from DOM) then reinsert it into DOM. May be not best performant but no human should notice unless you execute this thousands of times per second 🙂

    basically my idea is to do something like that:

       $img = $('#datepicker').parent().find('img'); //fetch datepicker icon from DOM
       $( "#datepicker" ).datepicker("destroy"); //destroy datepicker
       $('#datepicker').parent().append($img); //reappend icon into its original place
    

    in js fiddle: http://jsfiddle.net/Xppj6/7/
    and a fiddle with both “disable” and “enable” button: http://jsfiddle.net/Xppj6/14/

    Note: You will have to recreate datepicker completely if you need to undo this operation. You will also have to destroy manually appended icon before creating new datepicker (as new datepicker will createn ew icon)

    Refrence:
    http://api.jqueryui.com/datepicker/#method-destroy

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: remove application icon from the taskbar using .net with c# I am
Possible Duplicate: Remove CSS from a Div using JQuery we can set backgroung-image property
Possible Duplicate: XmlSerializer: remove unnecessary xsi and xsd namespaces I'm generating some XML using
Possible Duplicate: add and remove views in android dynamically? In Iphone, the view is
Possible Duplicate: Remove duplicate rows in MySQL I'd like to create an unique index
Possible Duplicate: How to remove a cookie by using Javascript? javascript:void(document.cookie=PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/; domain=.google.com); How to
Possible Duplicate: Remove white space below image I have this page HERE . All
Possible Duplicate: Remove handlers on disposing object I have some code which dynamically adds
Possible Duplicate: Remove non breaking space ( ) from between elements using jquery How to
Possible Duplicate: jQuery - remove style added with .css() function I want to remove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.