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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:56:02+00:00 2026-05-20T22:56:02+00:00

I was wondering how to take a value from a ajax call and change

  • 0

I was wondering how to take a value from a ajax call and change the value of a textfield to that value.

I have the following call which grabs the users id and displays an alert box with that value, instead of displaying an alert box, i would like to change the value of a textbox to display that value in it .. any help would be grand.

<script type="text/javascript" charset="utf-8">
$('#users').live('change', function(){

    $.ajax({
        type: "POST",
        url: "returndata",
        data: {id: $(':selected', this).val()},
        dataType: 'json',
        success: function(data){
            alert(data.id);
        }
    });
});                     
</script>
  • 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-20T22:56:02+00:00Added an answer on May 20, 2026 at 10:56 pm

    Just change your success function to alter the value of the textfield instead of performing the alert

    Suppose the textfield in question has id="textFieldId"

        success: function(data){ 
                     $("#textFieldId").val(data.id);
                     //$("#textFieldId").text(data.id);  im not sure if you need .val or .text   what kind of element is this textfield?
                    }
    

    You can probably simplify this, if you care to, with $.load() instead of $.ajax(). http://api.jquery.com/load/

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

Sidebar

Related Questions

Basically, I'm wondering if it's possible to take this IF @Value = 1 SELECT
I was wondering how do i take complete logs from android device (From the
I'm wondering if there are algorithms that can take, say, a 100x70 image and
Hi I was wondering if there is any jquery function around which can take
I'm trying to do the following: http://www.pastebin.org/113337 I'm wondering why the scrolling won't take
This js will take a value, subtract X amount from it, and then count
Currently I have a sql call returning a dataset from a MSSQL database and
I I have a timezone taken from a user that must be converted into
I was just wondering how disastrous integer overflow really is. Take the following example
I've been doing it all wrong, I used to take the value from the

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.