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>
javascript jquery asp.net-mvc
add a comment |
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>
javascript jquery asp.net-mvc
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
add a comment |
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>
javascript jquery asp.net-mvc
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
javascript jquery asp.net-mvc
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
add a comment |
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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>
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
add a comment |
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
add a comment |
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%2f53413292%2ftypeerror-valid-is-not-a-function%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
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