Copied to clipboard

Flag this post as spam?

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


  • Paul Yates 32 posts 86 karma points
    Mar 31, 2014 @ 18:19
    Paul Yates
    0

    Contour pre-requisites

    Are there any pre-requisites for Contour to work?  I'm thinking jQuery/jQueryUI, what version etc.

    I'm trying to get the Contour date picker to display and nothing is happening, i want to debug on a vanilla site so i'd like to know what it needs at a minimum and go from there.

    For what its worth - i'm on Umbraco 6.1.3

    Thanks

    Paul

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 31, 2014 @ 20:05
    Jan Skovgaard
    0

    Hi Paul

    No pre-requisites should be necessary since jquery is inserted when needed.

    However I think there might be some issues since if you load jquery after Contour tries to load jquery ui then you will get an error.

    Have you had a look in the console log of your web browser to see if it reveals some javascript errors?

    Perhaps it's also a good idea to consult the installation documentation of Contour

    /Jan

  • Paul Yates 32 posts 86 karma points
    Apr 02, 2014 @ 16:26
    Paul Yates
    0

    Yes there are javascript errors... very puzzling... here's what they are, from the start.  

    So I have my minmal site with no starter kit, installed and works fine.  v6.1.3 (also tried 6.1.6 its exactly the same)

    Installing Contour works fine, i always get could not load control error as below (seems odd) but deleting the script manager in formsdashboard.ascx fixes that.

     

     

    If i create a Contour form and add it to a page then it doesnt work because... there is a script error... "jQuery is not defined"  which means... i *do* need to include jQuery in my pages???

    So adding jQuery into my template

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>

    It still doesn't work however i now get another more useful script error:

    1. Uncaught TypeError: Cannot call method 'setDefaults' of undefined contourform.js:5
    2. 5: $.validator.setDefaults({

           ignore: ":hidden"

        });

    Though i now have no idea what to do with this.

     

    In case there is something in the 6.1.x version, i tried v7, installed a starter kit (txt) and then Contour, and... its *exactly the same error*

    1. Uncaught TypeError: Cannot call method 'setDefaults' of undefined contourform.js:5
    What is going on....??

  • Steve Wilkinson 132 posts 211 karma points
    Apr 07, 2014 @ 08:48
    Steve Wilkinson
    0

    I'm having a similar problem with the datepicker not showing http://our.umbraco.org/forum/umbraco-pro/contour/49662-DatePicker-works-in-preview-but-not-on-web-form?p=0#comment177803

    Looking at the java console, I'm getting two "jQuery is not defined" errors, one in the index page in this part

     var contourFieldValues87c5a5b35e3741818100443e9c2643f0;
    
        (function ($) {
            $(function () {
    
                $("#contour_form_Changeofaddress .contourPage input").change(function() {
                    PopulateFieldValues87c5a5b35e3741818100443e9c2643f0();
                    CheckRules87c5a5b35e3741818100443e9c2643f0();
                });
    
                $("#contour_form_Changeofaddress .contourPage select").change(function () {
                    PopulateFieldValues87c5a5b35e3741818100443e9c2643f0();
                    CheckRules87c5a5b35e3741818100443e9c2643f0();
                });
    
                PopulateFieldValues87c5a5b35e3741818100443e9c2643f0();
                CheckRules87c5a5b35e3741818100443e9c2643f0();               
            });
    
        } (jQuery));  
    

    and the other in contourform.js

    (function ($) {
    
    
    
    $.validator.setDefaults({
        ignore: ":hidden"
    });
    
    $.validator.unobtrusive.adapters.addBool("requiredcb", "required");
    
    $.validator.addMethod('contour_selectonefromlist', function (value, element) {
        var valid = false;
        $("input", $(element).closest(".checkboxlist, .radiobuttonlist")).each(function (i) {
            if ($(this).is(':checked')) { valid = true; }
        });
        return valid;
    });
    
    $.validator.unobtrusive.adapters.addBool("requiredlist", "contour_selectonefromlist");
    
    $.validator.addMethod('contour_regex', function (value, element) {
    
        var regex = $(element).attr("data-regex");
        var val = $(element).val();
        if (val.length == 0) { return true; }
        return val.match(regex);
    });
    
    $.validator.unobtrusive.adapters.addBool("regex", "contour_regex");
    
    $(function () {
    
        $("#PreviousClicked").val("");
    
    
        $(".datepickerfield").datepicker({ dateFormat: contourDateFormat });
    
        $(".cancel").click(function () {
            $("#PreviousClicked").val("clicked");
        });
    
    
    
        $('input[type=submit]').not('.cancel').click(function (evt) {
            evt.preventDefault();
            var self = $(this);
            var frm = self.closest('form');
            frm.validate();
            if (frm.valid()) {
                frm.submit();
                self.attr('disabled', 'disabled');
    
            }
        });
    });
    
    } (jQuery));
    
  • Steve Wilkinson 132 posts 211 karma points
    Apr 07, 2014 @ 08:51
    Steve Wilkinson
    0

    This is the js includes:

    <script src="/scripts/libs/jquery-1.10.2.min.js"></script>
    <script src="/scripts/libs/bootstrap.min.js"></script>
    
    <script src="/Scripts/libs/jquery.hoverIntent.minified.js"></script>
    <script src="/Scripts/ulgMegaMenu.js"></script>
    
    <script src="/scripts/zozo.tabs.js"></script>

    This code is in the preview

    <script type="text/javascript" src="scripts/jquery-1.5.1.min.js"></script>
    
    <script type="text/javascript" src="scripts/jquery-ui-1.8.11.min.js"></script>
    <script type="text/javascript" src="scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="scripts/jquery.validate.unobtrusive.min.js"></script>

    but isn't in the master template - I did try adding it but it didn't seem to make any difference.

  • Steve Wilkinson 132 posts 211 karma points
    Apr 07, 2014 @ 08:53
    Steve Wilkinson
    0

    oops, got some of the code outside the code tags

    <script type="text/javascript" src="scripts/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="scripts/jquery-ui-1.8.11.min.js"></script>
    <script type="text/javascript" src="scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="scripts/jquery.validate.unobtrusive.min.js"></script>
    

    do I need to add the javascript files into the Scripts\libs?

  • Wesley de Roo 38 posts 142 karma points
    May 20, 2014 @ 15:47
    Wesley de Roo
    0

    I've changed line 36 in the contourform.js file in 'umbraco\Plugins\umbracoContour\scripts\Frontend'

    $(".datepickerfield").datepicker({ dateFormat: contourDateFormat });
    

    to

    if ($(".datepickerfield").length > 0) { //checks if the page has a class with .datepickerfield
        $(".datepickerfield").datepicker({ dateFormat: contourDateFormat });
    }
    

    disadvantage is that after upgrading you're losing the change

    update: never mind this post, posted in the wrong forumpost, must be: http://our.umbraco.org/forum/umbraco-pro/contour/45030-clientside-validation-fails-on-contour-3

Please Sign in or register to post replies

Write your reply to:

Draft