TypeError: $(…).valid is not a function











up vote
-1
down vote

favorite












I am trying to use the validate but it gives me the error valid is not a function



function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}


NB: I am using <script src="~/Scripts/jquery.validate.js"></script>










share|improve this question
























  • I think you can not add validation js that's why it shows this type of error
    – Jinesh
    Nov 21 at 13:45










  • @Borealis I guess you are missing jQuery library
    – Shiladitya
    Nov 21 at 13:47















up vote
-1
down vote

favorite












I am trying to use the validate but it gives me the error valid is not a function



function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}


NB: I am using <script src="~/Scripts/jquery.validate.js"></script>










share|improve this question
























  • I think you can not add validation js that's why it shows this type of error
    – Jinesh
    Nov 21 at 13:45










  • @Borealis I guess you are missing jQuery library
    – Shiladitya
    Nov 21 at 13:47













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I am trying to use the validate but it gives me the error valid is not a function



function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}


NB: I am using <script src="~/Scripts/jquery.validate.js"></script>










share|improve this question















I am trying to use the validate but it gives me the error valid is not a function



function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}


NB: I am using <script src="~/Scripts/jquery.validate.js"></script>







javascript jquery asp.net-mvc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 20:37







user3559349

















asked Nov 21 at 13:37









Borealis

484314




484314












  • I think you can not add validation js that's why it shows this type of error
    – Jinesh
    Nov 21 at 13:45










  • @Borealis I guess you are missing jQuery library
    – Shiladitya
    Nov 21 at 13:47


















  • I think you can not add validation js that's why it shows this type of error
    – Jinesh
    Nov 21 at 13:45










  • @Borealis I guess you are missing jQuery library
    – Shiladitya
    Nov 21 at 13:47
















I think you can not add validation js that's why it shows this type of error
– Jinesh
Nov 21 at 13:45




I think you can not add validation js that's why it shows this type of error
– Jinesh
Nov 21 at 13:45












@Borealis I guess you are missing jQuery library
– Shiladitya
Nov 21 at 13:47




@Borealis I guess you are missing jQuery library
– Shiladitya
Nov 21 at 13:47












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Here you go with a solution






function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>





You were missing jQuery core.



Please check in browser network tab whether jquery.validate.js is loading or not.






share|improve this answer





















  • I am using this <script type="text/javascript" src="/Scripts/jquery-3.1.1.min.js"></script> and the jquery.validate.js is loading
    – Borealis
    Nov 21 at 13:52












  • @Borealis Can you check whether jQuery core is loading in browser network tab & it's loading before jQuery validate, because jQuery validate has a dependency on jQuery core
    – Shiladitya
    Nov 21 at 13:59











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',
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%2f53413292%2ftypeerror-valid-is-not-a-function%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Here you go with a solution






function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>





You were missing jQuery core.



Please check in browser network tab whether jquery.validate.js is loading or not.






share|improve this answer





















  • I am using this <script type="text/javascript" src="/Scripts/jquery-3.1.1.min.js"></script> and the jquery.validate.js is loading
    – Borealis
    Nov 21 at 13:52












  • @Borealis Can you check whether jQuery core is loading in browser network tab & it's loading before jQuery validate, because jQuery validate has a dependency on jQuery core
    – Shiladitya
    Nov 21 at 13:59















up vote
0
down vote













Here you go with a solution






function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>





You were missing jQuery core.



Please check in browser network tab whether jquery.validate.js is loading or not.






share|improve this answer





















  • I am using this <script type="text/javascript" src="/Scripts/jquery-3.1.1.min.js"></script> and the jquery.validate.js is loading
    – Borealis
    Nov 21 at 13:52












  • @Borealis Can you check whether jQuery core is loading in browser network tab & it's loading before jQuery validate, because jQuery validate has a dependency on jQuery core
    – Shiladitya
    Nov 21 at 13:59













up vote
0
down vote










up vote
0
down vote









Here you go with a solution






function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>





You were missing jQuery core.



Please check in browser network tab whether jquery.validate.js is loading or not.






share|improve this answer












Here you go with a solution






function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>





You were missing jQuery core.



Please check in browser network tab whether jquery.validate.js is loading or not.






function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>





function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 at 13:48









Shiladitya

9,36891830




9,36891830












  • I am using this <script type="text/javascript" src="/Scripts/jquery-3.1.1.min.js"></script> and the jquery.validate.js is loading
    – Borealis
    Nov 21 at 13:52












  • @Borealis Can you check whether jQuery core is loading in browser network tab & it's loading before jQuery validate, because jQuery validate has a dependency on jQuery core
    – Shiladitya
    Nov 21 at 13:59


















  • I am using this <script type="text/javascript" src="/Scripts/jquery-3.1.1.min.js"></script> and the jquery.validate.js is loading
    – Borealis
    Nov 21 at 13:52












  • @Borealis Can you check whether jQuery core is loading in browser network tab & it's loading before jQuery validate, because jQuery validate has a dependency on jQuery core
    – Shiladitya
    Nov 21 at 13:59
















I am using this <script type="text/javascript" src="/Scripts/jquery-3.1.1.min.js"></script> and the jquery.validate.js is loading
– Borealis
Nov 21 at 13:52






I am using this <script type="text/javascript" src="/Scripts/jquery-3.1.1.min.js"></script> and the jquery.validate.js is loading
– Borealis
Nov 21 at 13:52














@Borealis Can you check whether jQuery core is loading in browser network tab & it's loading before jQuery validate, because jQuery validate has a dependency on jQuery core
– Shiladitya
Nov 21 at 13:59




@Borealis Can you check whether jQuery core is loading in browser network tab & it's loading before jQuery validate, because jQuery validate has a dependency on jQuery core
– Shiladitya
Nov 21 at 13:59


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413292%2ftypeerror-valid-is-not-a-function%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

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks