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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:59:56+00:00 2026-05-16T10:59:56+00:00

The user sees a form with many controls, including a list box. He selects

  • 0

The user sees a form with many controls, including a list box. He selects a single item in the list box and presses “submit”.

In PHP I access $_POST[] and want to display the list box as read-only or disabled with his his selected item also selected. It should be read-only or disabled because I am showing him what he submitted and I don’t want him changing it.

Can someone please give a very simple code example? (it has to work in MS IE (not my choice))


Edit for clarification:

There are two forms – a submission form in HTMl and a processing & acknowledgement form in PGP.

The first form offers a choice in many controls, the second verifies the input and, if valid, displays the input form again with a confirmation message. On this second form all fields must be static.

I have a problem only with a listbox (size >1, not combobox). I want to display ll of the initial choices but the user should not be allowed to change the selection, i.e, display all items, with one selected as either readonly or disabled.

  • 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-16T10:59:57+00:00Added an answer on May 16, 2026 at 10:59 am
    <form action="" method='post'>
    <?php 
    $disabled = isset($_POST['list'])?"disabled='disabled'":"";
    ?>
    <select name='list' <?php echo $disabled;?> >
      <?php $selected = isset($_POST['list'])&&$_POST['list']=="1"?"selected='selected'":"";?>
      <option value="1" <?php echo $selected;?>>option1</option>
      <?php $selected = isset($_POST['list'])&&$_POST['list']=="2"?"selected='selected'":"";?>
      <option value="2" <?php echo $selected;?>>option2</option>
    </select>
    
    <input type="submit" value="Submit" />
    </form>
    

    i know i know… it looks horrible, there are cleaner ways to do it. but it works as an example

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

Sidebar

Related Questions

The user sees a web form with a bunch of controls. One of them
I have a form with some text-inputs: login, password. If user sees this form
I'm writing a simple file uploader for a website. The user sees a form:
A user sees a form on the screen. He has to fill in a
Lets say I have a really simple html form: <form action=./whatever.php method=POST> <input type=submit
In my blog application, some posts appear as excerpts -- i.e., the user sees
User is a model. I have 100 users. I need to present the list
User Controls -- Do they serve a special purpose? As far as I can
I'm creating a web page based on user input from a form. After the
Curious about user notification techniques. Referring to simple stuff. For example, a user submit's

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.