You are here: Re: [PHP] making checkbox's and radio buttons sticky « PHP « IT news, forums, messages
Re: [PHP] making checkbox's and radio buttons sticky

Posted by Jochem Maas on 08/12/05 04:18

zedleon wrote:
> I am new to php and am in need of some guidance
> I am building a sticky form and am having trouble bringing in the data

sticky as in honey?

> fields for
> checkbox's and radio button's. Any help on how to do this would be
> appreciated
>
> HTML form sample
> <input name="gmev[]" type="checkbox" id="gmev" value="September 9th"></th>
>
> PHP
> <input name="gmev[]" type="checkbox" id="gmev" value="<? echo $gmev_day
> ?>"></th>
>
> am I on the right track here?

maybe, partially - generally radio buttons and checkboxes have fixed values -
it's the 'are they selected' part that probably want to make dynamic...
basically you need to conditionally add the attribute 'checked' (i.e.
checked="checked") to the radios and checkboxes you want selected when the
form is first shown.

e.g.

<?

if ($thisChkBoxIsInitiallySelected) {
$checked = ' checked="checked"';
} else {
$checked = '';
}

echo '<input name="gmev[]" type="checkbox" id="gmev"',$checked,'/>';

?>

of course there are a million different ways to write this kind of thing
(i.e. don't take my example verbatim perse) but hopefully you get the idea.

>
> zed
>

 

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

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