If else else if in Jquery for a condition

0 votes

I am having a set of text fields where i am doing validation Say I am Having a field called "seats" this can accept value less than "99999".Meaning I should not able to enter the "99999" any thing less than that is ok. For that I wrote below if and else if . please tell me whether I am doing any thing wrong. I am confused a lot from morning whether it should be less than or greater than

if ($("#seats").val() != '') {
    setflag = false;
    alert("Not a valid character")
}
else if($("#seats").val() < 99999) {
    alert("Not a valid Number");
} else {
    setflag = true;
}

Jul 1 in Web Development by gaurav
• 17,000 points
7 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

How do write IF ELSE statement in a MySQL query

You probably want to use a CASE ...READ MORE

answered Feb 18 in Web Development by Aditya
• 7,300 points
19 views
0 votes
0 answers

How to add a link in Jquery PrettyPhoto to download the image

I am using Jquery PrettyPhoto to have ...READ MORE

Jun 29 in Web Development by gaurav
• 17,000 points
11 views
0 votes
0 answers

JQuery $.ajax() post - data in a java servlet

I want to send data to a ...READ MORE

Jun 29 in Web Development by gaurav
• 17,000 points
50 views
0 votes
0 answers

how to get values of columns for a selected row through jQuery

here i am trying to fetch values ...READ MORE

Jul 1 in Web Development by gaurav
• 17,000 points
59 views
0 votes
0 answers

Clear background if content present in textarea (jQuery)

Please see this jsFiddle: https://jsfiddle.net/Wmq6f/ I have a textarea ...READ MORE

Jul 22 in Web Development by gaurav
• 17,000 points
8 views
0 votes
1 answer

Using jQuery in a Blackboard Building Block

The previous answer is correct in that ...READ MORE

answered Jul 26 in Web Development by rajatha
• 7,040 points
8 views
0 votes
1 answer

addID in jQuery?

To answer your doubt, ID is an ...READ MORE

answered Feb 8 in Others by Soham
• 8,740 points
78 views
0 votes
1 answer

jQuery find all elements with class beneath parent, even in children elements

Remove > from your select $(".parent .searchEl"). You can use the .find() method ...READ MORE

answered Jun 7 in JQuery by Edureka
• 13,640 points
65 views
0 votes
0 answers

jQuery find and replace string

I have somewhere on website a specific ...READ MORE

Jun 10 in JQuery by gaurav
• 17,000 points
45 views
0 votes
1 answer

Difference between :hidden and :not(:visible) in jQuery

During animations that hide an element, the ...READ MORE

answered Jun 14 in JQuery by gaurav
• 17,000 points
20 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP