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 9016277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:57:18+00:00 2026-06-16T03:57:18+00:00

We are useing the default datepicker for jQuery ( http://jqueryui.com/datepicker/ ) but im trying

  • 0

We are useing the default datepicker for jQuery ( http://jqueryui.com/datepicker/ ) but im trying to make a changeable datepicker.

I have a radio button that can be switched between a Delivery and a Pickup. I want costumers to be able to select Satherday when its pickup but unable to select sunday and satherday with Delivery.

I made some code but it doesnt seem to work

JS

  $('input[name=method]').change(function() {
    if ($(this).val() == 'pickup') {            
        $('.datepicker').datepicker({
                                beforeShowDay: function(date) {
                                    var day = date.getDay();
                                    return [(day != 0), ''];
                                }
                                });
    }

    else {
        $('.datepicker').datepicker({
                                beforeShowDay: $.datepicker.noWeekends
                                });
    }
  });

HTML

<h3>Overige informatie</h3>
<label>Afhalen/Bezorgen</label>
<br>
<div id="project_basket_orderinfoform-method">
   <label><input type="radio" id="project_basket_orderinfoform-method-pickup" name="method" value="pickup"  checked="checked" class=" radio"/>Afhalen</label>
   <label><input type="radio" id="project_basket_orderinfoform-method-deliver" name="method" value="deliver"  class=" radio"/>Bezorgen</label>
   <span class="required-marker">*</span>
</div>

<label for="project_basket_orderinfoform-delivery_date">Aflever-/afhaaldatum</label>
<br>
<input id="project_basket_orderinfoform-delivery_date" type="text" placeholder="" name="delivery_date" value="24-12-2012" class="datepicker datetime"/>

So basicly when i switch from Pickup to Delivery and back the datepicker doesnt change its setting beforeShowDay. I cant figure out whats going wrong… Im not that quite experienced with datepicker so i wonder did anyone else made this before or can someone see what is wrong with the code?

  • 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-16T03:57:20+00:00Added an answer on June 16, 2026 at 3:57 am

    Once you instantiate the datepicker, you cannot change its settings without using the “option” option or you can destroy the datepicker and recreate it.

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

Sidebar

Related Questions

I am using jquery datepicker http://jqueryui.com/datepicker/#default . I have to input fields like from
At the moment I'm using DatePicker (view-source:http://jqueryui.com/demos/datepicker/default.html) but I'm having difficulties adding Timepicker addon
I'm using jquery ui daterange datepicker http://jqueryui.com/demos/datepicker/#date-range my code is below it's pretty much
I have an input text containing a default date and I'm using jQuery's Datepicker
I have been using the default colors Grey and Blue for cell selection, but
I have a jquery datepicker which selects week number and a date range based
I want to use the jQuery default date picker , it's awesome, but I
I'm using the default jquery's date picker that is triggered by assigning the dp
I am using a Jquery Datepicker in my project. The problem is that it
If you create the app described in this tutorial http://developer.android.com/resources/tutorials/views/hello-datepicker.html change the date, and

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.