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

  • SEARCH
  • Home
  • 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 8354743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:38:47+00:00 2026-06-09T09:38:47+00:00

The validation Of Budget Range is not working in the below code. It Brings

  • 0

The validation Of Budget Range is not working in the below code. It Brings Different Results at different point of time.

<table>
    <tr>
        <td>
            Budget Range
        </td>
        <td>
            <select id="start">
                <option value="">---Select---</option>
                <option value="0">0</option>
                <option value="1000000">10 Lakhs</option>
                <option value="2500000">25 Lakhs</option>
                <option value="5000000">50 Lakhs</option>
                <option value="7500000">75 Lakhs</option>
                <option value="10000000">1 Crore</option>
                <option value="12500000">1 Crore 25 Lakhs</option>
                <option value="15000000">1 Crore 50 Lakhs</option>
                <option value="17500000">1 Crore 75 Lakhs</option>
                <option value="20000000">2 Crore</option>
                <option value="25000000">2 Crore 50 Lakhs</option>
                <option value="30000000">3 Crore</option>
                <option value="35000000">3 Crore 50 Lakhs</option>
                <option value="40000000">4 Crore</option>
                <option value="45000000">4 Crore 50 Lakhs</option>
            </select>
            to
            <select id="end" onchange="selectRange()">
                <option value="0">---Select---</option>
                <option value="1000000">10 Lakhs</option>
                <option value="2500000">25 Lakhs</option>
                <option value="5000000">50 Lakhs</option>
                <option value="7500000">75 Lakhs</option>
                <option value="10000000">1 Crore</option>
                <option value="12500000">1 Crore 25 Lakhs</option>
                <option value="15000000">1 Crore 50 Lakhs</option>
                <option value="17500000">1 Crore 75 Lakhs</option>
                <option value="20000000">2 Crore</option>
                <option value="25000000">2 Crore 50 Lakhs</option>
                <option value="30000000">3 Crore</option>
                <option value="35000000">3 Crore 50 Lakhs</option>
                <option value="40000000">4 Crore</option>
                <option value="45000000">4 Crore 50 Lakhs</option>
            </select>
        </td>
    </tr>
</table>
<script>

    function selectRange() {
        $startRange = document.getElementById('start').value;
        $endRange = document.getElementById('end').value;

        alert($startRange);
        alert($endRange);

        alert($startRange > $endRange);

        if ($startRange > $endRange) {
            alert('The Budget End Should be Greater than Budget Start');
            $endRange = document.getElementById('end').value = 0;
            return false
        }
    }
</script>

The validation Of Budget Range is not working in the above code. It Brings Different Results at different point of time.

  • 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-06-09T09:38:49+00:00Added an answer on June 9, 2026 at 9:38 am

    when you are getting value these are coming as string or your comparison is based on string value, so it is producing wrong result. cast them to number will help.
    just replace these line of code

    $startRange = document.getElementById('start').value;
    $endRange = document.getElementById('end').value;
    

    to

    $startRange = parseInt(document.getElementById('start').value,10);
    $endRange = parseInt(document.getElementById('end').value, 10);
    

    or

    $startRange = Number(document.getElementById('start').value);
    $endRange = Number(document.getElementById('end').value);
    

    and check this jsfiddle http://jsfiddle.net/QWLEW/2/ using parseInt function

    or check this http://jsfiddle.net/QWLEW/3/ using Number function

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

Sidebar

Related Questions

Date validation is not working properly. If day = 90, month = 1 and
I have a validation message self.errors.add_to_base(_(country cannot be deleted #{self.country_name})) this is not working.
After validation of select combo box which I have selected and I am not
Validation in Spring 3.x using @Valid annotation: Below is snippet from the messages_en.properties. I
Textarea validation, How to limit the characters in a textarea for not exceeding more
Custom Validation Control: <asp:CustomValidator ID=valSex runat=server ErrorMessage=1.2 &lt;b&gt;Sex&lt;/b&gt; not specified EnableClientScript=true ClientValidationFunction=ValidateSex SetFocusOnError=True>Selection required</asp:CustomValidator>
Below is my validation() function which controls some messages in an alert: function validation()
The validation sometimes works when tabbing but not always. For example, load webpage, delete
jQuery validation plugin doesn't seem to work with my code. The text fields are
Each time I call validation method on any model, I get the following error:

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.