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, 2022 in Web Development by gaurav
• 23,260 points
2,302 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, 2022 in Web Development by Aditya
• 7,680 points
416 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, 2022 in Web Development by gaurav
• 23,260 points
646 views
0 votes
0 answers

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

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

Jun 29, 2022 in Web Development by gaurav
• 23,260 points
1,690 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, 2022 in Web Development by gaurav
• 23,260 points
4,974 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, 2022 in Web Development by gaurav
• 23,260 points
273 views
0 votes
1 answer

Using jQuery in a Blackboard Building Block

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

answered Jul 26, 2022 in Web Development by rajatha
• 7,640 points
367 views
0 votes
1 answer

addID in jQuery?

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

answered Feb 8, 2022 in Others by Soham
• 9,700 points
3,583 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, 2022 in JQuery by Edureka
• 13,670 points
9,817 views
0 votes
0 answers

jQuery find and replace string

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

Jun 10, 2022 in JQuery by gaurav
• 23,260 points
4,582 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, 2022 in JQuery by gaurav
• 23,260 points
549 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP