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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:22:51+00:00 2026-05-21T07:22:51+00:00

I need to send the value and the text of a select box input

  • 0

I need to send the value and the text of a select box input in the php file I’m writing. I have jquery included.
I am passing the value in order to query the database, but since the name associated with the records is in another table, and I don’t want to do a join, I figure it would be easier to send the name (which has already been retrieved). I figure the easiest thing to do is to populate the value of a hidden input with something like this:

$('#individ option:selected').text()

Example

echo "<select id='individ' name='individ'>";
echo "<option value='1'>John Smith</option>";
echo "<option value='2'>Jim Dandy</option>";
echo "<option value='3'>Jane Fletcher</option>";
echo "</select><br />";

echo "<input type='hidden' name='selected_name' value=''>"; //the value of this needs to be the text from the select above    
  • 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-21T07:22:52+00:00Added an answer on May 21, 2026 at 7:22 am
    $('#individ').change(function () {
        $('[name="selected_name"]').val($('#individ option:selected').val());
    });
    

    I don’t know if that’s what you’re trying to do. I don’t see why you couldn’t just get the value of the select on post.

    If you need to do it without submitting, you’re going to have to do some ajax.

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

Sidebar

Related Questions

All,In my requirement need to send a mail with attached text file, which is
I Have a select box, on selectinga value in it I have to display
I have a input type=file tag in my html which allows user to select
Migrating from textboxe to dropdownlist – Need to send value from a hard-coded dropdownlist
Like below,I need to send name and psw value to server side, and get
I've a custom form (created with form API) that need send an uploaded file
I need to send MMS thought a C# application. I have already found 2
I have a drop-down list box and two text fields of id values namely
I need your help. I have tables using PHP while looping and I need
Possible Duplicate: How to get all options of a select using Jquery? I have

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.