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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:53:19+00:00 2026-05-30T02:53:19+00:00

I have two text boxes and i want to send these two text box

  • 0

I have two text boxes and i want to send these two text box names to one jsp page. By getting these two names in check.jsp i will do some calculation and will return the result by json to third text box, but i think i am doing wrong somewhere. Can anybody give me an idea?

<script type="text/javascript">
      $(document).ready(function() {
       $("#textbox").keyup(function () {// do i need to write another onkey up for another text box?
$.getJSON('check.jsp', {
    textboxname: this.value// here how can i send another text box name to check.jsp?
},function(data){
  // get data
 });
});
});
</script>

html

<input type="text" id="textbox" name="textboxname"/>// name goes to check.jsp
<input type="text" id="textbox1" name="textboxname1"/>// how can i send this text box's
 name to that same check.jsp
<input type="text" id="textbox2" name="textboxname2"/>// here i want to display the 
result received from check.jsp 

server side(check.jsp)

String firsttextboxname=request.getParameter("firsttextboxname");
String firsttextboxname1=request.getParameter("firsttextboxname1");
JSONObject jsonObj= new JSONObject(); 
jsonObj.put("isTrue","true");
response.setContentType("application/json");
response.getWriter().write(jsonObj.toString());
  • 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-30T02:53:22+00:00Added an answer on May 30, 2026 at 2:53 am
    <input type="text" id="textbox" class="submitme" name="textboxname"/>// name goes to check.jsp
    <input type="text" id="textbox1" class="submitme" name="textboxname1"/>// how can i send this text box's  
    
    <script type="text/javascript">
         $(document).ready(function() {
           $(".submitme").keyup(function () {
             $.getJSON('check.jsp', {
               textboxname: jQuery("#textbox").val(), textboxname2: jQuery("#textbox1").val()
               },function(data){
                    if (data.textboxname != "" && data.textboxname2 != "") {
                      jQuery("#textbox2").val(JSON.stringify(data));
                    }
                    else {
                      jQuery("#textbox2").val("");
                    }
                 }
             });
           });
         });
    </script>
    

    ——OR AS A POST———–

    $.ajax({
      type: 'POST',
      url: 'check.jsp',
      data: { textboxname: jQuery("#textbox").val(), textboxname2: jQuery("#textbox1").val() },
      success: function(data) {
         jQuery("#textbox2").text(JSON.stringify(data));
      },
      dataType: 'JSON'
    });
    

    I’ll comment to say your doing a couple things I wouldn’t.

    1) Why not send this data via a POST

    2) Why send data everytime a key is pressed, why not bind this to a submit button?

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

Sidebar

Related Questions

I have a form with two text boxes, in one I want to show
I have two text boxes t1 and t2 in an html page. I'd like
I have a form with two text boxes, one select drop down and one
I have two text boxes that I want users to fill with geolocation data
I have two text boxes and I want skip a block of code only
I have two text boxes, one for a billing address field and one for
I have a form in which I want two check boxes to be required
I have two text boxes (select) which I want to change the contents of
I have a php form with two text boxes and i want to enter
Say i have a table row with the two text boxes and i want

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.