Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Aug 18, 2010 @ 12:08
    Tim
    1

    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

    Aug 18, 2010 @ 12:10

    Hi Tim, you simply need to add the runat="server" attribute to your head tag

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Aug 18, 2010 @ 12:15
    Tim
    0

    Thanks Tim!

    :)

  • Anthony Barsotti 26 posts 66 karma points
    Jan 08, 2014 @ 00:20
    Anthony Barsotti
    0

    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. 

  • Ryan Green 63 posts 83 karma points
    Jan 08, 2014 @ 19:10
    Ryan Green
    0

    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..

  • Anthony Barsotti 26 posts 66 karma points
    Jan 08, 2014 @ 19:21
    Anthony Barsotti
    0

    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.

  • Ryan Green 63 posts 83 karma points
    Jan 08, 2014 @ 19:23
    Ryan Green
    0

    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.

  • Ryan Green 63 posts 83 karma points
    Jan 08, 2014 @ 19:47
    Ryan Green
    0

    FIXED IT!!!!

    For me, with some figuring out, I added these three lines, right above where my content placeholder in my template is:

    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js"></script>  
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js" type="text/javascript"></script>    
    <script src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
    

    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.

  • Anthony Barsotti 26 posts 66 karma points
    Jan 08, 2014 @ 19:57
    Anthony Barsotti
    0

    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

    Jan 08, 2014 @ 19:57

    Yeah it uses jquery ui datepicker atm so you'll need to include that

  • Ryan Green 63 posts 83 karma points
    Jan 16, 2014 @ 15:28
    Ryan Green
    0

    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.

  • Ryan Green 63 posts 83 karma points
    Jan 16, 2014 @ 15:44
    Ryan Green
    0

    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.

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft