Picking up laundry (Coffee Cup Form...
Hello you all,
I might have submitted this thread in the wrong place, so please excuse me....
I've got some issues with two datepickers on my form for picking up and returning laundry.
1. In Europe, weeks begin with Monday
2. I don't want customers to be able to choose weekenddays
3. The return date (item 157) must at least be 1 day after the pick-up day (item20).
With the following code these above mentioned items work, but I have 2 problems.
Problem 1:
I can't get the functions $(window).load(function() and $(document).ready(function () to work, so the datepickers do eventually work properly, but when I click on the datefield the default datepicker shows up and only when I click a date the right datepicker shows up.
You can see what happens at http://toonvankrieken.nl/Ophaalservice.html
Problem 2:
People can contact us until 17.00h to pick up the laundry the same day. But after 17.00h the datepicker should show the next day.
Can someone help me?
<script type='text/javascript' src='../jquery-1.9.1.js'></script>
<script type="text/javascript" src="../jquery-ui.js"></script>
<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">
$(window).load(function(){
$(document).ready(function () {
$ function () {
// 0 = sunday, 1 = monday, 2 = tuesday, 3 = wednesday,
// 4=thursday, 5 = friday, 6=satday
var daysToDisable = [6, 0];
$('#item20_date_1').datepicker({firstDay: 1,dateFormat: "dd-mm-yy", beforeShowDay: disableSpecificWeekDays, minDate: 0,
onSelect: function (date) {
var date2 = $('#item20_date_1').datepicker('getDate');
date2.setDate(date2.getDate() + 1);
$('#item157_text_1').datepicker('setDate', date2);
//sets minDate to dt1 date + 1
$('#item157_text_1').datepicker('option', 'minDate', date2);
}
});
$('#item157_text_1').datepicker({firstDay: 1, dateFormat: "dd-mm-yy", beforeShowDay: disableSpecificWeekDays});
function disableSpecificWeekDays(date) {
var day = date.getDay();
for (i = 0; i < daysToDisable.length; i++) {
if ($.inArray(day, daysToDisable) != -1) {
return [false];
}
}
return [true];
}
});
</script>
I might have submitted this thread in the wrong place, so please excuse me....
I've got some issues with two datepickers on my form for picking up and returning laundry.
1. In Europe, weeks begin with Monday
2. I don't want customers to be able to choose weekenddays
3. The return date (item 157) must at least be 1 day after the pick-up day (item20).
With the following code these above mentioned items work, but I have 2 problems.
Problem 1:
I can't get the functions $(window).load(function() and $(document).ready(function () to work, so the datepickers do eventually work properly, but when I click on the datefield the default datepicker shows up and only when I click a date the right datepicker shows up.
You can see what happens at http://toonvankrieken.nl/Ophaalservice.html
Problem 2:
People can contact us until 17.00h to pick up the laundry the same day. But after 17.00h the datepicker should show the next day.
Can someone help me?
<script type='text/javascript' src='../jquery-1.9.1.js'></script>
<script type="text/javascript" src="../jquery-ui.js"></script>
<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">
$(window).load(function(){
$(document).ready(function () {
$ function () {
// 0 = sunday, 1 = monday, 2 = tuesday, 3 = wednesday,
// 4=thursday, 5 = friday, 6=satday
var daysToDisable = [6, 0];
$('#item20_date_1').datepicker({firstDay: 1,dateFormat: "dd-mm-yy", beforeShowDay: disableSpecificWeekDays, minDate: 0,
onSelect: function (date) {
var date2 = $('#item20_date_1').datepicker('getDate');
date2.setDate(date2.getDate() + 1);
$('#item157_text_1').datepicker('setDate', date2);
//sets minDate to dt1 date + 1
$('#item157_text_1').datepicker('option', 'minDate', date2);
}
});
$('#item157_text_1').datepicker({firstDay: 1, dateFormat: "dd-mm-yy", beforeShowDay: disableSpecificWeekDays});
function disableSpecificWeekDays(date) {
var day = date.getDay();
for (i = 0; i < daysToDisable.length; i++) {
if ($.inArray(day, daysToDisable) != -1) {
return [false];
}
}
return [true];
}
});
</script>
This
and this
are the same.
$(document).ready(function() {
and this
$(function(){
are the same.
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
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
Hi Eric, thanks the first part works.
The only thing I've got to do is to set minDate of the first datepicker to 1 instead of 0 after 17.00h.
I wrote this and set the minDate to minDate:EvalMinDate, but it doesn't work.
What am I doing wrong?
function EvalMinDate(date) {
var time = date.getHours();
if(time < 17) {
return[0];
}
}
return[1];
}
});
The only thing I've got to do is to set minDate of the first datepicker to 1 instead of 0 after 17.00h.
I wrote this and set the minDate to minDate:EvalMinDate, but it doesn't work.
What am I doing wrong?
function EvalMinDate(date) {
var time = date.getHours();
if(time < 17) {
return[0];
}
}
return[1];
}
});
Will this form always be submitted from your time zone?
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
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
Hi Eric,
Yes it will. It's a local dutch laundry.....
Yes it will. It's a local dutch laundry.....
Hi Eric,
I've been trying all evening and this is the solution:
var d = new Date();
var newMinDate = (d.getHours() > 16) ? "1":"0";
$('#item20_date_1').datepicker('setDate', newMinDate);
//sets minDate to dt1 date + 1
$('#item20_date_1').datepicker('option', 'minDate', newMinDate);
Anyway I wish to thank you for your quick response!
I've been trying all evening and this is the solution:
var d = new Date();
var newMinDate = (d.getHours() > 16) ? "1":"0";
$('#item20_date_1').datepicker('setDate', newMinDate);
//sets minDate to dt1 date + 1
$('#item20_date_1').datepicker('option', 'minDate', newMinDate);
Anyway I wish to thank you for your quick response!



IE works OK, Chrome doesn't!
Chrome of all things is weird for scripts. I'm trying to figure why it's messing up on another script I wrote. It seems to be the only browser with an issue.
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
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
I would post the question on the Chrome developer forum. Please post back when you get an answer.
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
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.