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)
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
add a comment |
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
Since you're gettingvalue
from the user, runningeval
on it is quite dangerous.
– Heretic Monkey
2 days ago
add a comment |
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
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
c# asp.net-mvc unobtrusive-validation
edited 2 days ago
Sparky
82.6k20151239
82.6k20151239
asked 2 days ago
Evan BarkeEvan Barke
4118
4118
Since you're gettingvalue
from the user, runningeval
on it is quite dangerous.
– Heretic Monkey
2 days ago
add a comment |
Since you're gettingvalue
from the user, runningeval
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Since you're getting
value
from the user, runningeval
on it is quite dangerous.– Heretic Monkey
2 days ago