You are here: Re: Set the selected text for option box of a menu.. « PHP Programming Language « IT news, forums, messages
Re: Set the selected text for option box of a menu..

Posted by Jonathan N. Little on 10/19/06 13:01

Advo wrote:
<snip>

> Yet, when they return to the page, there value they selected is not
> shown in this box, instead, theres just a gap. The source seems
> correct, and this is whats shown:
>
> <select name="title" id="title">
> <option value="Mr" selected="selected"></option>
>
> so it is working like that, but still not showing anything.

Because you have made an HTML markup error with the OPTION element. You
are missing the 'displayed' text...

<option value="parsedValue">Displayed Value</option>

Your code:
> <?php
> if($_SESSION['title'] != "") {
> echo '<option value="'. $_SESSION['title'] .'"
> selected="selected"></option>';
> }
> ...

Needs to be:

if($_SESSION['title'] != "") {
echo '<option value="'. $_SESSION['title'] .'"selected="selected">' .
$_SESSION['title'] .'</option>'; }
....

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация