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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:54:50+00:00 2026-05-25T11:54:50+00:00

A select list in a form, I know there’s no problem to pass the

  • 0

A select list in a form, I know there’s no problem to pass the option value using post or get. But if I also want to pass the select id value, is it possible and how?
For example:

<form action="Test.php" method="POST">
                <select name="select" id = '1'>
                    <option value="">Select a Status</option>
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                </select>                
                <input type="submit" value="submit"/>
            </form>

And here is the simple print php code:

<?php
    print_r($_POST['select']);
?>

It can print the value of the option that has been chosen, but how to modify the code if I also want to post the id value, which is 1 here. I want to do so because I want the id to become a variable to store some int numbers. Thank you!

  • 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-25T11:54:50+00:00Added an answer on May 25, 2026 at 11:54 am

    The id attribute is designed purely for use in client side code. If you want to pass extra data, then use hidden inputs — that is what they are designed for.

    <input type="hidden" name="select_extra" value="1">
    <select name="select">
        <option value="">Select a Status</option>
        <option value="0">0</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
    </select>                
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use the selected value of a select list when the form
Template: <form method=POST action=/Bycategory/> <input type=radio name=andor1 value=1 checked> <input type=radio name=andor1 value=2> <select
I have a select list I've created in a form alter, however, when I
I have written a simple CRUD form which has one select list. However the
I have a html form which have a select list box from which you
I have a select list which is being populated using the values from a
I added the columns in the select list to the order by list, but
I have a situation where the second select list option is generated from the
[EDIT] To be clear, I know how to get a list of forms via
I am using the Select->DropDownCheckList from http://dropdown-check-list.googlecode.com/svn/trunk/src/demo.html ... with a PHP back end... This

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.