Reply to Re: select tag

Your name:

Reply:


Posted by Toby Inkster on 07/07/06 07:02

Jonathan N. Little wrote:

> Two things. One, you did not quote, tsk-tsk. Two, you missed everyone's
> point, a SELECT element with *no* OPTIONS is invalid and makes no sense.
> If that situation occurs you should not create the SELECT but instead
> some indication that no options exist...

My favourite way of doing this (in PHP) is:

<?php

$started = FALSE;
while ($data = pg_fetch_array($results))
{
if (!$started)
{
print "<select blah blah blah>\n";
$started = TRUE;
}
printf("\t<option>%s</option>\n", htmlentities($data['option']));
}
if ($started)
print "</select>\n";

unset($started);

?>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

[Back to original 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

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