> Date: Wed, 31 Aug 2011 04:30:56 -0400
> From: rob...@myself.com
> To: php-general@lists.php.net
> Subject: [PHP] scroll down list -visible, but not possible to choose
> Hi,
>  Got so excellent and fast help last time so trying again here
>  I have the below function with array for satus of issues where I need to 
> have 'Resolved/Closed' visible but not available for choice
>  This as closing is a separate function to ensure correct resolution code is 
> selected 
> Already tried removing 'Resolved', and got everything working only to notice 
> when testing that when viewing issues the Resolved
>  ones showed up as 'Support Working' even though closed in the system
>  function print_statuses($selected) {
>  $statuses = array('Resolved','Support Working','Waiting on 
> Customer','New','Read Update');
>  foreach($statuses as $status) {
>  echo "<option value=\"$status\"";
>  if($status == $selected) echo ' selected';
>  echo ">$status</option>";
>  }
>  }

The HTML attribute 'disabled' for the option tag might help you out here.
Another option would be to catch off selection of the 'Resolved' state when 
parsing the submission of the form.
Lastly you could alter the script to display something else instead of the 
selection box when the 'Resolved' state applies.

Personally I think the latter is the most elegant solution.


Reply via email to