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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:56:18+00:00 2026-06-16T01:56:18+00:00

I have a form in which the form should automatically search when I complete

  • 0

I have a form in which the form should automatically search when I complete entering the 10th character in the text field but the below code is searching for each n every character I enter in the text field . . . I just want the result after completing the 10th character not for each n every character . . I have used onkeyup event and I set that value to 10 but still it is searching for each n every character… please do help me

<body OnKeyPress="return disableKeyPress(event)">
<section id="content" class="container_12 clearfix" data-sort=true>
    <center><table class='dynamic styled with-prev-next' data-table-tools='{'display':true}' align=center>
        <script>
        function disableEnterKey(e)
        {
            var key;      
            if(window.event)
                key = window.event.keyCode; //IE
            else
                key = e.which; //firefox      

            return (key != 13);
        }

        function showUser(str)
        {

            if (str=="")
            {
                document.getElementById("txtHint").innerHTML="";
                return;
            } 
            if (window.XMLHttpRequest)
            {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp=new XMLHttpRequest();
            }
            else
            {// code for IE6, IE5
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange=function()
            {
                if (xmlhttp.readyState==4 && xmlhttp.status==200)
                {
                    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
                }
            }
            xmlhttp.open("GET","resdb.php?id="+str,true);
            xmlhttp.send();
        }
        </script>

        <script type='text/javascript'>
        //<![CDATA[ 
        $(window).load(function(){
            $('#id').keyup(function(){
                if(this.value.length ==10)
            });
        });//]]>  

        </script>



        <form id="form" method="post" name="form" >
            <tr><td><p align="center"><font size="3"><b>JNTUH - B.Tech IV Year II Semester (R07)   Advance Supplementary Results - July 2012</b></font></p></td></tr>
            <td><p align="center"><b>Last Date for RC/RV : 8th August 2012</b></p></td>
            <tr><td><p align="center"></b> <input type="text" onkeyup="showUser(this.value)"   onKeyPress="return disableEnterKey(event)" data-type="autocomplete"  data-source="extras/autocomplete1.php" name="id" id="id" maxlength="10" placeholder="Hall-Ticket Number">&emsp;</p></td></tr>
        </form>
    </center>
</table>
<center>
    <div id="txtHint"><b>Results will be displayed here</b></div>
</center>
</body>
  • 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-16T01:56:20+00:00Added an answer on June 16, 2026 at 1:56 am

    This is an idea as your code is working. Do it this way. First check your textfield if it is more than 10 character or not. call fnc() onkeyup

    function fnc()
     {
      length=document.getElementById("atext").value.length;
      if(length==10)
      {
          callyourajaxfunction()
       }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code, which should adds a field to a form if
I have an ASP.NET form (C#) but which I click this button that should
I have a page which should show a form with checkboxes, post back if
I have a form with a field that uses a date/time picker which produces
I have a windows form application which consists of a bunch of controls, but
If I wanted to conditionally set which field should have focus using ASP.NET WebForms,
I have lots of form inputs with automatically generated IDs which look like the
I have a form which I want to be 'resusable' for a variety of
I have a form which has a RichTextBox docked to the left and DataGridView
I have a form which POST's its data via AJAX: $.ajax({ type: POST, url:

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.