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

The Archive Base Latest Questions

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

I have a drop down in html. When I change the value of the

  • 0

I have a drop down in html.

When I change the value of the drop down I want to store the selected value in a php variable

How can i achieve this ?

  • 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-13T23:26:58+00:00Added an answer on May 13, 2026 at 11:26 pm

    Technically it is impossible. PHP is server side, HTML is client side. When a user calls up a URL the server runs the PHP which gets sent to the HTML, so you can not go backwards.

    You can however use ajax to get the value of the select box and use it in some meaningful way. What are you wanting to do with this variable?

    EDIT

    Using jQuery I would send the value of the select box to an ajax file, and then have the ajax file create the text box if the value is what you want it to be. Here is an example.

    $("#selectEle").change(function() {
        $.ajax({
            type: "POST",
            url: "yourajaxpage.ajax.php",
            data: {selectVal: $(this).val()},
            success: function(response) {
                $("#textBoxArea").html(response);
            },
            error: function() { alert("Ajax request failed."); }
        }
    });
    

    You will grab the value in your ajax page using $_POST[‘selectVal’]. Test that value there, and create an HTML textbox which gets sent back to the success function.

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

Sidebar

Related Questions

I have a drop down menu in my html, and what I want is
If I have a drop down list as follows <div class=editor-label> <%= Html.DropDownListFor(model =>
I have a drop down like this on my page: <p> <%= f.label :episode_id
I have a drop down list where users can select a theme for the
I have this code on controller side to initialise the drop down List<SelectListItem> items
I have the below jquery function $(function(){ $(select#rooms).change(function(){ $.getJSON(/admin/select.php,{id: $(this).val(), ajax: 'true'}, function(j){ var
So, basically I have this select / drop down menu that I use AJAX
I have an html table of data with a drop down box in each
I have a drop down menu, with two options: <select name="chs" value="" id =
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>

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.