Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6868065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:23:17+00:00 2026-05-27T03:23:17+00:00

so, my problem here is that my code seems to be recognizing that 100

  • 0

so, my problem here is that my code seems to be recognizing that 100 is < 2000, but its not recognizing that 200 < 1000

heres my code (i also use jquery as a framework FYI)

$('.filter-price').submit(function(e) {

    var alert_message = '';
    var price_from = $('.filter-price #price_from').val();
    var price_to = $('.filter-price #price_to').val();

    if (isNaN(price_from))
    {
        alert_message += "Price from must be a number, i.e. 500\n";
        $('.filter-price #price_from').val('From');
    }

    if (isNaN(price_to))
    {
        alert_message += "Price to must be a number, i.e. 500\n";
        $('.filter-price #price_to').val('To');
    }

    if (!isNaN(price_from) && !isNaN(price_to) && (price_from >= price_to))
    {
        alert_message += "Price from must be less than price to\n";
        $('.filter-price #price_from').val('From');
        $('.filter-price #price_to').val('To');
    }

    if (alert_message != '')
    {
        e.preventDefault();
        alert(alert_message);
    }

});

i’ve tried using parseInt() on the vars which fixes nothing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:23:17+00:00Added an answer on May 27, 2026 at 3:23 am

    Sorry, but you really need to do this way:

    var price_from = parseInt($('.filter-price #price_from').val(), 10);
    var price_to = parseInt($('.filter-price #price_to').val(), 10);
    

    Look the result on chrome console:

    '200' >= '1000'
    true
    
    200 >= 1000
    false
    

    And if you don’t want to limit the numbers to int, replace parseInt(val, 10) to parseFloat(val)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now I'm not really sure what the problem here is but it seems that
Here is the code that cause me problem since few hours: TabItem newTab =
Here is the smallest amount of code that clearly illustrates my problem: <html> <body>
Basically my problem is that i've adapted a piece of code found here http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/62e70670-f306-4bb7-8684-549979af91c1
Here is my code: $('#right').load('textes.html #nicolas'); $('#right').load('textes.html #antoine'); The problem is that the content
I've got a problem similar to,but subtly different from, that described here (Loading assemblies
Here is a hum-dinger of a problem that I have not found an answer
Okay, I'm not doing anything fancy here, but it's driving me crazy that I
I've got a problem here with an MSI deployment that I'm working on (using
I'm having a strange problem here... I have an ASP.NET 3.5 application that has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.