Does anyone know what I need to include on my front end page to get the date picker to work? It works ok in the preview in the back end, but I just get a calendar rendered with no form field on the front end.
I thought I would just need a script manager on the page, which I've tried including, but it doesn't seem to do anything. Anyone know what I need to include?
Adding the runat="server" tag did not remedy the situation for me. I'm experiencing a similar issue where I can click the text input in the form preview and the datepicker displays but on the actual published form nothing happens upon clicking the input.
I think it has to do with a jQuery problem. Are you loading jQuery already for something else. It looks like Contour now uses jQuery for the datepicker. I am running into the same issue, and have not found a way around it. I am using jQuery elsewhere on the page, and I believe it is conflicting with the Contour form that has a datepicker on it..
I am loading JQuery in the head of my site (I think it's 1.9.1) but it looks like Contour loads in JQuery UI on its own. At first I thought that might be the problem so I linked to JQuery UI from Google but that didn't fix it.
Same here, I just tried removing the other jQuery calls from my page. So, I only had the contour form, and it still doesn't load the datepicker. The conditional fields work correctly, so I know it has nothing to do with that. I think it really has something to do with the jQuery used.
I did not add the call for jQuery min, however, since I am already calling a newer version (1.9.0), and it works, my jquery objects all work, as well as the datepicker.
Now onto figuring out how to disable dates in the past.
Hopefully this works for you.
What's really weird is that on the test form in the backoffice, it loads these, but on a page it does not.
I tried placing that in a few different places in my templates including the bottom of the head tags and before a few different content placeholders but every time I click the datepicker I get an error in the console related to the Jquery UI file. It says "Uncaught TypeError: Cannot read property 'msie' of undefined." I think this is because $.browser was removed in 1.9. I'll try using an older version of JQuery or the JQuery migrate plugin. Thanks!
Adding that worked thanks! I feel like I experienced this issue once before a few months ago and I vaguely remember having to add the validate plugin to fix it.
Well, what I thought had fixed it didn't. It worked for a short time. Then, when I had to reinstall Contour it doesn't work again. I tried removing all other references to other jquery, and it still doesn't work.
Ok, got it working. What is happening is, there are two "Insert Form From Contour" options in the macro dropdown. Of course, all my previous forms were inserted using the original 1.12 version of contour, so when I create a new form within 3.0.18 and I use the insert for that one, the datepicker works, still including the code I referenced above.
So, how do I know which one to remove, there are also two Recaptcha's showing up in the form field dropdown in Contour as well. The old one, and the new one. The old one errors on the test form, but the new one works. How do I remove that one as well.
I just used the Install from the repository to upgrade Contour to 3.0.18
Datepicker not rendering
Does anyone know what I need to include on my front end page to get the date picker to work? It works ok in the preview in the back end, but I just get a calendar rendered with no form field on the front end.
I thought I would just need a script manager on the page, which I've tried including, but it doesn't seem to do anything. Anyone know what I need to include?
Comment author was deleted
Hi Tim, you simply need to add the runat="server" attribute to your head tag
Thanks Tim!
:)
Adding the runat="server" tag did not remedy the situation for me. I'm experiencing a similar issue where I can click the text input in the form preview and the datepicker displays but on the actual published form nothing happens upon clicking the input.
I think it has to do with a jQuery problem. Are you loading jQuery already for something else. It looks like Contour now uses jQuery for the datepicker. I am running into the same issue, and have not found a way around it. I am using jQuery elsewhere on the page, and I believe it is conflicting with the Contour form that has a datepicker on it..
I am loading JQuery in the head of my site (I think it's 1.9.1) but it looks like Contour loads in JQuery UI on its own. At first I thought that might be the problem so I linked to JQuery UI from Google but that didn't fix it.
Same here, I just tried removing the other jQuery calls from my page. So, I only had the contour form, and it still doesn't load the datepicker. The conditional fields work correctly, so I know it has nothing to do with that. I think it really has something to do with the jQuery used.
FIXED IT!!!!
For me, with some figuring out, I added these three lines, right above where my content placeholder in my template is:
I did not add the call for jQuery min, however, since I am already calling a newer version (1.9.0), and it works, my jquery objects all work, as well as the datepicker.
Now onto figuring out how to disable dates in the past.
Hopefully this works for you.
What's really weird is that on the test form in the backoffice, it loads these, but on a page it does not.
I tried placing that in a few different places in my templates including the bottom of the head tags and before a few different content placeholders but every time I click the datepicker I get an error in the console related to the Jquery UI file. It says "Uncaught TypeError: Cannot read property 'msie' of undefined." I think this is because $.browser was removed in 1.9. I'll try using an older version of JQuery or the JQuery migrate plugin. Thanks!
Adding that worked thanks! I feel like I experienced this issue once before a few months ago and I vaguely remember having to add the validate plugin to fix it.
Comment author was deleted
Yeah it uses jquery ui datepicker atm so you'll need to include that
Well, what I thought had fixed it didn't. It worked for a short time. Then, when I had to reinstall Contour it doesn't work again. I tried removing all other references to other jquery, and it still doesn't work.
Ok, got it working. What is happening is, there are two "Insert Form From Contour" options in the macro dropdown. Of course, all my previous forms were inserted using the original 1.12 version of contour, so when I create a new form within 3.0.18 and I use the insert for that one, the datepicker works, still including the code I referenced above.
So, how do I know which one to remove, there are also two Recaptcha's showing up in the form field dropdown in Contour as well. The old one, and the new one. The old one errors on the test form, but the new one works. How do I remove that one as well.
I just used the Install from the repository to upgrade Contour to 3.0.18
The one highlighted in blue is the new one.
is working on a reply...