Custom validation failing with “Cannot read property 'call' of undefined” MVC jquery2019 Community Moderator ElectionValidation failed for one or more entities. See 'EntityValidationErrors' property for more detailsASP.NET MVC: Custom Validation by DataAnnotationMVC unobtrusive validation - Custom validator that depends on a previous selectionASP.NET MVC Custom Validator not triggeringJquery Unobtrusive Validation 'Cannot read property 'type' of undefined'MVC Foolproof validation - Cannot read property 'value' of undefinedHow to customize ASP.net MVC jquery unobtrusive validation message displayWhy do I get periodic Uncaught TypeError: Cannot read property 'value' of undefined when setting the value of multiple dropdownlists?How to validate a list of checkbox through custom jQuery in asp.net mvcCannot read property value of undefined (ASP.NET MVC)

Draw this image in the TIKZ package

How to distinguish easily different soldier of ww2?

Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?

Why restrict private health insurance?

What does *dead* mean in *What do you mean, dead?*?

Tool for measuring readability of English text

Did Amazon pay $0 in taxes last year?

Are small insurances worth it?

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

Inorganic chemistry handbook with reaction lists

Unfamiliar notation in Diabelli's "Duet in D" for piano

Why isn't P and P/poly trivially the same?

Was this cameo in Captain Marvel computer generated?

Will the concrete slab in a partially heated shed conduct a lot of heat to the unconditioned area?

Having the player face themselves after the mid-game

What can I do if someone tampers with my SSH public key?

Sort array by month and year

Giving a talk in my old university, how prominently should I tell students my salary?

What is Tony Stark injecting into himself in Iron Man 3?

Short story about an infectious indestructible metal bar?

How to educate team mate to take screenshots for bugs with out unwanted stuff

Why does a car's steering wheel get lighter with increasing speed

Do I need a return ticket to Canada if I'm a Japanese National?

How can I portion out frozen cookie dough?



Custom validation failing with “Cannot read property 'call' of undefined” MVC jquery



2019 Community Moderator ElectionValidation failed for one or more entities. See 'EntityValidationErrors' property for more detailsASP.NET MVC: Custom Validation by DataAnnotationMVC unobtrusive validation - Custom validator that depends on a previous selectionASP.NET MVC Custom Validator not triggeringJquery Unobtrusive Validation 'Cannot read property 'type' of undefined'MVC Foolproof validation - Cannot read property 'value' of undefinedHow to customize ASP.net MVC jquery unobtrusive validation message displayWhy do I get periodic Uncaught TypeError: Cannot read property 'value' of undefined when setting the value of multiple dropdownlists?How to validate a list of checkbox through custom jQuery in asp.net mvcCannot read property value of undefined (ASP.NET MVC)










0















I can't for the life of me figure out the problem with this script. I'm doing a custom validation as in this post https://www.codeproject.com/Tips/780992/Asp-Net-MVC-Custom-Compare-Data-annotation-with-Cl



The only thing I changes was some date format handling. See my customcompare.js here:



$.validator.addMethod("genericcompare", function (value, element, params) params.length == 0 );
$.validator.unobtrusive.adapters.add("genericcompare",
["comparetopropertyname", "operatorname"], function (options)
options.rules["genericcompare"] = "#" +
options.params.comparetopropertyname + "," + options.params.operatorname;
options.messages["genericcompare"] = options.message;
);


The error I am getting is : "Uncaught TypeError: Cannot read property 'call' of undefined. Exception occurred when checking element LaycanStartDate, check the 'genericcompare' method"



Model:



[Display(Name = "LaycanStartDate", ResourceType = typeof(Resources.Resources))]
[DataType(DataType.DateTime)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0:dd/MM/yyyy hh:mm")]
[GenericCompare(CompareToPropertyName = "LaycanEndDate", OperatorName = GenericCompareOperator.LessThanOrEqual, ErrorMessageResourceName = "LaycanStartBeforeEnd",ErrorMessageResourceType = typeof(Resources.Resources))]
public DateTime LaycanStartDate get; set;









share|improve this question
























  • Since you're getting value from the user, running eval on it is quite dangerous.

    – Heretic Monkey
    2 days ago















0















I can't for the life of me figure out the problem with this script. I'm doing a custom validation as in this post https://www.codeproject.com/Tips/780992/Asp-Net-MVC-Custom-Compare-Data-annotation-with-Cl



The only thing I changes was some date format handling. See my customcompare.js here:



$.validator.addMethod("genericcompare", function (value, element, params) params.length == 0 );
$.validator.unobtrusive.adapters.add("genericcompare",
["comparetopropertyname", "operatorname"], function (options)
options.rules["genericcompare"] = "#" +
options.params.comparetopropertyname + "," + options.params.operatorname;
options.messages["genericcompare"] = options.message;
);


The error I am getting is : "Uncaught TypeError: Cannot read property 'call' of undefined. Exception occurred when checking element LaycanStartDate, check the 'genericcompare' method"



Model:



[Display(Name = "LaycanStartDate", ResourceType = typeof(Resources.Resources))]
[DataType(DataType.DateTime)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0:dd/MM/yyyy hh:mm")]
[GenericCompare(CompareToPropertyName = "LaycanEndDate", OperatorName = GenericCompareOperator.LessThanOrEqual, ErrorMessageResourceName = "LaycanStartBeforeEnd",ErrorMessageResourceType = typeof(Resources.Resources))]
public DateTime LaycanStartDate get; set;









share|improve this question
























  • Since you're getting value from the user, running eval on it is quite dangerous.

    – Heretic Monkey
    2 days ago













0












0








0








I can't for the life of me figure out the problem with this script. I'm doing a custom validation as in this post https://www.codeproject.com/Tips/780992/Asp-Net-MVC-Custom-Compare-Data-annotation-with-Cl



The only thing I changes was some date format handling. See my customcompare.js here:



$.validator.addMethod("genericcompare", function (value, element, params) params.length == 0 );
$.validator.unobtrusive.adapters.add("genericcompare",
["comparetopropertyname", "operatorname"], function (options)
options.rules["genericcompare"] = "#" +
options.params.comparetopropertyname + "," + options.params.operatorname;
options.messages["genericcompare"] = options.message;
);


The error I am getting is : "Uncaught TypeError: Cannot read property 'call' of undefined. Exception occurred when checking element LaycanStartDate, check the 'genericcompare' method"



Model:



[Display(Name = "LaycanStartDate", ResourceType = typeof(Resources.Resources))]
[DataType(DataType.DateTime)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0:dd/MM/yyyy hh:mm")]
[GenericCompare(CompareToPropertyName = "LaycanEndDate", OperatorName = GenericCompareOperator.LessThanOrEqual, ErrorMessageResourceName = "LaycanStartBeforeEnd",ErrorMessageResourceType = typeof(Resources.Resources))]
public DateTime LaycanStartDate get; set;









share|improve this question
















I can't for the life of me figure out the problem with this script. I'm doing a custom validation as in this post https://www.codeproject.com/Tips/780992/Asp-Net-MVC-Custom-Compare-Data-annotation-with-Cl



The only thing I changes was some date format handling. See my customcompare.js here:



$.validator.addMethod("genericcompare", function (value, element, params) params.length == 0 );
$.validator.unobtrusive.adapters.add("genericcompare",
["comparetopropertyname", "operatorname"], function (options)
options.rules["genericcompare"] = "#" +
options.params.comparetopropertyname + "," + options.params.operatorname;
options.messages["genericcompare"] = options.message;
);


The error I am getting is : "Uncaught TypeError: Cannot read property 'call' of undefined. Exception occurred when checking element LaycanStartDate, check the 'genericcompare' method"



Model:



[Display(Name = "LaycanStartDate", ResourceType = typeof(Resources.Resources))]
[DataType(DataType.DateTime)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0:dd/MM/yyyy hh:mm")]
[GenericCompare(CompareToPropertyName = "LaycanEndDate", OperatorName = GenericCompareOperator.LessThanOrEqual, ErrorMessageResourceName = "LaycanStartBeforeEnd",ErrorMessageResourceType = typeof(Resources.Resources))]
public DateTime LaycanStartDate get; set;






c# asp.net-mvc unobtrusive-validation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Sparky

82.6k20151239




82.6k20151239










asked 2 days ago









Evan BarkeEvan Barke

4118




4118












  • Since you're getting value from the user, running eval on it is quite dangerous.

    – Heretic Monkey
    2 days ago

















  • Since you're getting value from the user, running eval on it is quite dangerous.

    – Heretic Monkey
    2 days ago
















Since you're getting value from the user, running eval on it is quite dangerous.

– Heretic Monkey
2 days ago





Since you're getting value from the user, running eval on it is quite dangerous.

– Heretic Monkey
2 days ago












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023370%2fcustom-validation-failing-with-cannot-read-property-call-of-undefined-mvc-jq%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023370%2fcustom-validation-failing-with-cannot-read-property-call-of-undefined-mvc-jq%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved