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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:31:00+00:00 2026-05-29T23:31:00+00:00

I have a text box in index.jsp and after writing something i am calling

  • 0

I have a text box in index.jsp and after writing something i am calling a jsp by jquery. But my requirement is if a particular value will be matched in server side then how can i auto refresh that text box? It means suppose i entered apple then by onkeyup event i am sending the name(apple) to check.jsp and in this jsp page, I have kept apple in a string. So now an alert will come in index.jsp that apple already exists and simulatenously that text box will be auto refreshed. How can i do it? I am a beginner to this field.

index.jsp

<script type="text/javascript">
  $(document).ready(function() {
    $("#textbox").keyup(function () {
        $.getJSON('check.jsp', {
            textboxname: this.value
        });
    });
  }); 
</script>

inside body

<input type="text" id="textbox" name="textboxname"/>

check.jsp

String textboxname=request.getParameter("textboxname");
  • 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-29T23:31:01+00:00Added an answer on May 29, 2026 at 11:31 pm

    on keyup send the value to the server and if it matches return true or false, then in the success handler check what is returned if its true refresh and not do something

    $("#textbox").keyup(function () {
            $.getJSON('check.jsp', {
                textboxname: this.value
            },function(data){
              if(data.isTrue){
                  alert("the value already exists");
                  $("#textbox").val(''); //clear the text box                                  
             }
              else
                  //do something                 
             });
        });
    }); 
    

    on the server not the exact servlet code but you’ll get the idea

    JSONObject match = new JSONObject();
    
     //if value matches 
         match.put("isTrue","true");
     else
        match.put("isTrue","false");
    response.setContentType("application/json");
    response.getWriter().write(match.toString());true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text box(having name b) and one submit button in index.jsp .
i have form where i have text box value and link (add). when user
I have a text box for searching. For some reason, .blur() will not work
I have a form in index.jsp and after clicking submit i am showing an
I have placed a list box and a text box with Selected Index Changed
I have text box to enter a phone number. I'm using AJAX MaskedEditExtender and
I have text box in which your adds values in comma separated values. Once
I have a text-box into which a user can input a comment. The comment
I have a text box and a button, if I enter some text in
I have a text box that contains lines of data similar to this: sheep

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.