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 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 this code which can display drop down in div tag of html.
I have an HTML control: <select id=grade> I want to get the selected value
I have a drop down menu in my html, and what I want is
I have 2 drop down menus, I want this: when I choose option in
I have a drop down menu that I want to change to a multiple
I have defined a drop down list in html as follows. I have appended
If I have a drop down list as follows <div class=editor-label> <%= Html.DropDownListFor(model =>
Afternoon all. I have a drop down list in my view <div class=editor-label> @Html.LabelFor(model
I am creating one form in html using table. Which have one Drop down
I have a <select> drop down that I'm inserting into my HTML via jQuery.

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.