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 9239037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:53:45+00:00 2026-06-18T07:53:45+00:00

The jQuery code below works very well and checks for input values based on

  • 0

The jQuery code below works very well and checks for input values based on conditions, but for the ESNList text field in the HTML form, many ESNs (numbers) can be entered and separated by a comma in the same text field. How can I make so jQuery makes sure that all the numbers entered on the same text field still match the condition for ESNList? Your help would be greatly appreciated.

 <html>
    <head>
    <script type="text/javascript" src="jquery/jquery-1.8.3.js"></script>
    <script type="text/javascript">
    
    $(function () {
    
    
    $(":text").css("border", "2px solid red");
      $(":text").keyup(function(){
        var enteredData = $(this).val()
        console.log(enteredData);
        if (enteredData == "") {
          $(this).css("border", "2px solid red");
        } else {
          $(this).css("border", "inherit");
        }
        if ($(this).attr("id") == "ESNList"){
          esnList = parseInt(enteredData);
          switch (true){
            case ( esnList >= 986329 && esnList <= 999999):
                $("#ddl_StxName").val("stx2");
                $("#ddl_rtumodel").val("globalstar");
                break;
            case ( esnList >= 660000 && esnList <= 699999):
                $("#ddl_StxName").val("mmt");
                $("#ddl_rtumodel").val("globalstar");
                break;
            case ( esnList >= 200000 && esnList <= 299999):
                $("#ddl_StxName").val("stm3");
                $("#ddl_rtumodel").val("stmcomtech");
                break;
            case ( esnList >= 1202114 && esnList <= 1299999):
                $("#ddl_StxName").val("smartone");
                $("#ddl_rtumodel").val("globalstar");
                break;
          }
          
        }
      });
      });
    </script> </head>
    <body>
    <form id="provision">
        ESNList:    <input  type="text" id="ESNList" name="ESNList" size="30" /> <br />
        ESN Start:<input type="text" id="ESNStart" name="ESNStart" size="10" /> <br />
        ESN End: <input type="text" id="ESNStart" name="ESNStart" size="10" /> <br />
        UnitName:<input type="text" id="STxName" name="STxName" size="30"  />  <br />  
         Unit Model:   <select name="STxName" id="ddl_StxName">
        <option value="stx2">STX2</option>
        <option value="stm3" selected>STM3</option>
        <option value="acutec">Acutec</option>
         <option value="trackpack">Trackpack</option>
        <option value="mmt">MMT</option>
        <option value="smartone">Smartone</option>
        <option value="smartoneb" >SmartOneB</option>
        </select> <br />
        RTU Model Type:
         <select name="rtumodel" id ="ddl_rtumodel">
        <option value="globalstar">GlobalStar</option>
        <option value="both">Both</option>
        <option value="comtech">Comtech</option>
        <option value="stmcomtech">STMComtech</option>
        </select> <br />
        <input type="submit" value ="submit"  />
        </form>
    </body>
    </html> 
     
  • 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-18T07:53:46+00:00Added an answer on June 18, 2026 at 7:53 am

    You can split the list by a comma delimiter and validate each individual element.

    $.each(enteredData.split(","), function(i, str){
        var esnList = +str;
        /* enter validation here */
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below works very well for resizing an image by aspect ratio by
I'm using the jQuery code below to launch an overlay div and it works
I am having a very specific problem in JQuery The code below is used
I implement very big script logic using jquery plugin at caret(http://code.google.com/p/jquery-at-caret/), but now when
I did a code in jquery and ajax with working very well in Safari,
So I wrote the code below: jQuery('#contentWrapper').delegate(.addButton, click, function(){ addRow(jQuery(this)); }); function addRow(thisButton){ var
I am using the below jquery code to call a ajax function in my
Below is some jQuery code the i wrote to make a simple animation. However
I have this javascript code below that uses jquery, it is suppoed to be
I am using jquery to create a custom dropdown with the code below. I

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.