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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:35:14+00:00 2026-05-26T13:35:14+00:00

My knowledge about javascript is very low; thus, this is a simple question. I

  • 0

My knowledge about javascript is very low; thus, this is a simple question. I have a simple jQuery Ajax function as

$(document).ready(function(){
   $('#txtValue').keyup(function(event){
      if(event.which == 13){
            sendValue($(this).val());   
      }
   }); 
});

function sendValue(str){
    $.post("test.php",{ sendValue: str },
    function(data){
        $('#display').html(data.returnValue);
    }, "json");
}

This sends the json response to with id=”display”

<input type="text" name="txtValue" value="" id="txtValue">
<div id="display"></div>

But instead I want to put the json response as value of another INPUT element in a different form as

<form method="get" action="result.php">
<input id="DISPLAY" type="text" name="something" value="" />
<input type="submit" value="Submit" />
</form>

I want to put json response to and instead of

  • 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-26T13:35:14+00:00Added an answer on May 26, 2026 at 1:35 pm

    If you want to put return value to input, you need to use .val(data.returnValue) instead of .html(data.returnValue)

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

Sidebar

Related Questions

I have a fair knowledge about Javascript, I started with jQuery 1.4 a week
How can I write this PHP code in JavaScript? I have no knowledge about
I just started out with C and have very little knowledge about performance issues
My SQL knowledge is very limited, specially about SQLite, although I believe this is
I just started to read about this new technology... Does someone have some knowledge
I just discovered the what c# knowledge should I have? question and wondered about
Ok, so this is maybe a very basic question about REST concepts or Rails
My knowledge about implementing a parser is a bit rusty. I have no idea
I have some knowledge about Human computer interaction and some basic knowledge programming scripts
I'm unemployed and I have a job interview tomorrow where knowledge about Websphere 5.x

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.