Copied to clipboard

Flag this post as spam?

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


  • Jeric 122 posts 192 karma points
    Apr 05, 2013 @ 14:06
    Jeric
    0

    Cannot call method 'setDefaults' for contourform.js

    I've tried to pull in a contour form to be used in a page and got the above error.

    Full error details:
    Uncaught TypeError: Cannot call method 'setDefaults' of undefined 

    It's happening in "contourform.js" line (4) as below

    var contourFieldValues;
    (function ($) {
    $.validator.setDefaults({
    ignore: ":hidden"
    });

    $.validator.unobtrusive.adapters.addBool("requiredcb", "required");
    ........

     

    Just wasn't so sure how to resolve this. Appreciate all help.

    Thanks

     

  • Jeric 122 posts 192 karma points
    Apr 05, 2013 @ 17:44
    Jeric
    0

    I need to style a particular form so inside the "View > Forms" I've created another folder with the Form Id and placed
    both the below inside

    •  FieldType.Textfield.cshtml
    • Form.cshtml
    But my Form.cshtml is having lots of Red color text in Visual Studio indicating errors. not really sure what's the issue
    The form can be loaded but i'm not able to send out anything with  "Cannot call method ' setDefaults' for contourform.js"
     
  • Halle 9 posts 59 karma points
    May 03, 2013 @ 11:19
    Halle
    0

    Hi Jeric!

    I don't know if you have found a solution yet?
    but the reason why those methods generate errors is because there are some errors in the text format of the @Inherit line.( i've hade this problem aswell)

    To fix this you have to go into the form.cshtml file via a text editor (i.e notepad) and change the font to the proper one.
    For the moment i don't have any explaination for this, but i assume it is either the author of this file or MVC is generating some strange fonts.
    (haven't hade time to research why it occurs)

    And the reason why that method can't be called probably has to do with "jquery validator" being loaded after contourform.js or not at all.

    Hope that helps. 

    Best Regards,
    Hampus 

     

  • denisedelbando 141 posts 339 karma points
    Nov 13, 2013 @ 18:51
    denisedelbando
    0

    Hello what does this mean? "To fix this you have to go into the form.cshtml file via a text editor (i.e notepad) and change the font to the proper one"

Please Sign in or register to post replies

Write your reply to:

Draft