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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:04:51+00:00 2026-05-20T10:04:51+00:00

Im having trouble trying to figure out some code someone has suggested and was

  • 0

Im having trouble trying to figure out some code someone has suggested and was hoping someone could explain it a bit more, or suggest something easier.

I have 3 textboxes which i need to fill with dynamic data from a MySQL database, which data is shown is dependant on what the user clicks in a select dropdown box.

The code i have is the following:

<script type="text/javascript">
 jQuery(function( $ ){    
  $("select").change(function(e) {  
   $(".temp").load(\'index.php?parameter1=\'+ $(this).val(), , function() {
    $(".textbox1").val($(".temp1").text());
   });
  });
 });
</script>

Im not quite sure how to use javascript so im unsure of how this works, and also what code would go into the index.php file?

Any help would be greatly appreciated.

Cheers

  • 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-20T10:04:52+00:00Added an answer on May 20, 2026 at 10:04 am

    Yea this is from me and it is quite simple.

    First 2 lines are just initialisation, no need to change ever.

    3rd is a change trigger on “select”, so all code inside this function will be executed when a selectbox changes its value. Using a class or id (.x, #x) would be better but in you example was none given.

    4th Line loads the content of the given url in that case eg: “index.php?parameter1=USA” into an element (div or whatever) that has the class temp.

    Finally in the 5th line this temporarly loaded content will be copyed in the textbox with the class texbox1.

    For this to work you need to include the jquery file, sth like this:

    <script src="jquery-latest.js" type="text/javascript"></script>
    

    Also there has to be: the given select, a textbox with the class textbox1, and a div (hidden) with the class temp

    In the index.php (or name it textboxvalues.php .. whatever) you just have to echo the values that you want to have in the textbox. You can use a switch or if for the parameters (for the differen textboxes) and get the values from a database or however you want. You can even use a different php file for each textbox. Whatever you want.

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

Sidebar

Related Questions

I'm writing some code in python and I'm having trouble when trying to retrieve
I'm having trouble with the iTunes XML duration column. I'm trying to figure out
Hey having some trouble trying to maintain transparency on a png when i create
I'm having a bit of trouble trying to get class variables to work in
I'm having some trouble installing and configuring qt on my vista laptop. I'm trying
I'm having some trouble figuring out how to generate the cartesian product of a
I'm having trouble trying to optimize the following query for sql server 2005. Does
I'm having trouble trying to set the value of a property after i cast
I am having real trouble trying to get decent answers to my questions from
Im trying to extract a line from wget's result but having trouble with it.

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.