Datepicker - noWeekends, - Page 2

User 2077947 Photo


Registered User
40 posts

Odd,

view-source:http://www.skipy.co.uk/skip_online_order_form.html#top

Line 70 should show your code

Line 74 </head>
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

Yup I cruised right by sorry about that.:P Let me take a look a sec.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,271 posts

Ok I forgot to tell you that you have to change the id of your datepicker in your form to something different. Then adjust the code in the script to that id. So for you adjust both to something like item250_date
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2077947 Photo


Registered User
40 posts

Hi again Eric,

I gave up last night, still no joy :(

I amended your code to show: $('#item250_date')

I amended line 1946 of the form to show: class="datepicker" id="item250_date"

but the calender won't appear. (I've tried it with and without the #)

I did notice that item250_date_1 also appears in the 'validation_data.js' file and amending that to: item250_date does allow the calender to appear but without restrictions as before.

I wish :(
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

It's working for me. Did you try ctrl + f5.;)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2077947 Photo


Registered User
40 posts

Fingers crossed, I think I've done it :D:D:D:D:D:D:D

I've been at it for hours, so I'm going to take a break but I've used this code and touch wood, I think it works!


<!--- Start of Datepicker Criteria --->

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {

$('#item250_date').datepicker({
minDate: 1,
maxDate: 60,
dateFormat: 'DD, dd-M-y',
beforeShowDay: $.datepicker.noWeekends
});
});
</script>
<script>
$(document).ready(function() {

$('#item59_date').datepicker({
minDate: 1,
maxDate: 60,
dateFormat: 'DD, dd-M-y',
beforeShowDay: $.datepicker.noWeekends
});
});
</script>

<!--- End of Datepicker Criteria --->
R K BAILEY
User 2077947 Photo


Registered User
40 posts

Many Thanks Eric, it appears to be working as it should now :D
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

Awesome! Have fun with your new discovery.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 371773 Photo


Registered User
10 posts

Hi Eric,

I have successfully implemented your script shown above (http://ericrohloff.com/coffeecup/ccforu … rweekends/) to block Saturdays from being selected on my form's calendar.

However, when I have the script installed, it often causes the conditional items to not display correctly (Zipline, Parasail, Offshore Snorkel, Spa & Fish) The conditional items (guest counts for each activity) should be a "required" item that open when one of the activities is selected. Since they don't always show-up, I've made them optional - so that the guests are able to submit their forms without requiring a "guest count"

Is there something I should do to make the form more "stable" and show the Calendar (with no Saturdays) and Conditional Items all the time?

Here is the form: http://boddentours.com/BestForm/BestForm.html

Thanks for any insight!
Matthew
User 187934 Photo


Senior Advisor
20,271 posts

Try it like this.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
var jQ = $.noConflict(true);
jQ(function () {
// 0 = sunday, 1 = monday, 2 = tuesday, 3 = wednesday,
// 4=thursday, 5 = friday, 6=satday
var daysToDisable = [6, 0];
jQ('#item1_date').datepicker({
beforeShowDay: disableSpecificWeekDays,
minDate: 0
});
function disableSpecificWeekDays(date) {
var day = date.getDay();
for (i = 0; i < daysToDisable.length; i++) {
if (jQ.inArray(day, daysToDisable) != -1) {
return [false];
}
}
return [true];
}
});
</script>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.