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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:57:05+00:00 2026-05-27T23:57:05+00:00

The HTML with the select value is: <select id=value_select onchange=get_value_js()> <option>Value 1</option> <option>Value 2</option

  • 0

The HTML with the select value is:

<select id="value_select" onchange="get_value_js()">
<option>Value 1</option>
<option>Value 2</option
</select>

The JavaScript code:

function get_value_js() {
var the_value = document.getElementById("value_select").value;
}

I don’t know how to continue the JavaScript to send the value to, for example, work.php. In work.php, I want to store the value in a PHP variable.

  • 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-27T23:57:05+00:00Added an answer on May 27, 2026 at 11:57 pm

    You can use AJAX.

    function get_value_js(){
      var xmlhttp;
      var e = document.getElementById("value_select");
      var the_value = e.options[e.selectedIndex].value;
      if (window.XMLHttpRequest)
        {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
        }
      else
        {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      xmlhttp.onreadystatechange=function()
        {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
          {
          //Do whatever with xmlhttp.responseText;
          }
        }
      xmlhttp.open("GET","work.php?val="+the_value,true);
      xmlhttp.send();
    }
    

    You can use $_GET[‘the_value’] to grab the value.

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

Sidebar

Related Questions

the html code: <div class=fr_search> <select class=search_l onchange=selectSearch(select)> <option value=0>whole site search</option> <option value=1>google
I have following code in a html form <select name=category class=input onchange=ShowTB(this,'suggest');> <option value=0
HTML Javascript question to get the selected value of a input-select I can use
in my .aspx page i have something like this: <select id=seltemp onchange=calltemp()> <option value=0
HTML <select multiple=multiple id=myID name=myName> <option value=blue>blue</option> <option value=red>red</option> <option value=green>green</option> </select> jQuery: $('select')
I have the following HTMl: <input id=brandID name=brandID type=hidden value= /> <select id=selectList class=textfield70pc
I've got an HTML select element which I'm updating dynamically with code something like
Is it possible to use JavaScript to open an HTML select to show its
Does the HTML select element have an on select event? what exactly is the
I've got an HTML select box that I need to style. I'd prefer to

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.