Disable One Future Day in Web Form...

User 187934 Photo


Senior Advisor
20,238 posts

Yes you can tweak and add that. I had an example in the forum some where. I have lost track of all the forms I've done.:lol:
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 2642607 Photo


Registered User
33 posts

I just revisited this post because I need to disable a specific date (25th August 2019).
However when I implemented the code in the html page of the form it is not working.
I know back in 2015 it did work and I cannot work out why it is not now.
Here is the code I am trying to use:
<!-- End of the headers for CoffeeCup Web Form Builder -->
<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">
$(function () {
var holidays = ["25/08/2019"]; //Enter the needed dates here.
$( "#item27_date_1" ).datepicker({
beforeShowDay: function(date){
var datestring = $.datepicker.formatDate('dd/mm/yy', date);
return [ holidays.indexOf(datestring) == -1 ]
}
});
});
</script>


Anyone any idea what I'm doing wrong?
I suspected a caching issue but this is not working on multiple browsers, when using Firefox I am clearing the cache, site data and cookies, then when reload it is still displaying the date 25th August 2019
User 2642607 Photo


Registered User
33 posts

The jquery version being loaded on the website is:
jQuery v1.11.1

So I suspected a conflict between jquery versions, below is the code I have just tried using 'jQuery.noConflict'
However it is still displaying the date I am trying to disable

<!-- End of the headers for CoffeeCup Web Form Builder -->
<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">
jQuery.noConflict();
(function( $ ) {
$(function () {
var holidays = ["25/08/2019"]; //Enter the needed dates here.
$( "#item27_date_1" ).datepicker({
beforeShowDay: function(date){
var datestring = $.datepicker.formatDate('dd/mm/yy', date);
return [ holidays.indexOf(datestring) == -1 ]
}
});
});
})( jQuery );
</script>
User 2642607 Photo


Registered User
33 posts

If it helps in solving this issue here is a link to the page where I am trying to implement the disable date code:

http://www.ecocameron.com/hill-and-forest-walk.html

(if not allowed to post link please advise and I will remove)

It is self hosted so no S Drive, any advice would be greatly appreciated
User 187934 Photo


Senior Advisor
20,238 posts

Hi Michael,
Give this a try.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
<script>
// ver 1
var jQ = $.noConflict(true);
jQ(function () {
jQ("#item27_date_1").attr("id","Date_Picker");
var holidays = ["25/08/2019"]; //Enter the needed dates here.
jQ("#Date_Picker").datepicker({
beforeShowDay: function(date){
var datestring = jQ.datepicker.formatDate('dd/mm/yy', date);
return [ holidays.indexOf(datestring) == -1 ]
}
});
});
</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
User 2642607 Photo


Registered User
33 posts

Hi Eric, that works, it works perfectly :)

Thank you so much for your assistance with this, I just spent 2 days trying to solve this and you just did it with just one post.

You are a tremendous asset to this community

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.