You are here: Re: multiple checkboxes « All PHP « IT news, forums, messages
Re: multiple checkboxes

Posted by IchBin on 12/03/06 18:10

Gaga wrote:
> 1.) what is the best way to store multiple checkboxes into table. (e.g. if
> you 20 checkboxes there is no reason to make 20 table fields ? )
>
> 2.) How to pull this stored checkbox data so i can display which checkboxes
> are checked and which not ?
>
>
>

I am new to php also and ran in to the same question. I have 2 rows and
26 columns for chars A->Z. This code is in a FORM NAME="author_abbrev"
and I POST the action to $_SERVER['PHP_SELF']. You can see it at
http://ichbin.9999mb.com if the free hosting site is running.

print '<table><tbody><tr>';
$loopValue = 1;
//
// Loop thru and build the 26 radio buttons with the correct
selected one
foreach (range('A', 'Z') as $letter)
{
if( $loopValue == 14)
{
print '</tr><tr>';
}
print '<td><input type="radio" name="abbr_letter" value="'.
$letter .'" ';
if( $letter == $_POST['abbr_letter']) print 'checked="checked" ';
print ' onclick="submit()" />'.$letter.'</td>';

$loopValue = $loopValue +1;
}
print '</tr></tbody></table>';


--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
______________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)

 

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

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