Re: checkboxes help ?
| From: | Joe Stump | Date: | Fri, 17 Nov 2000 17:34:47 +0000 |
| Subject: | Re: checkboxes help ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25925@lists.php.net to get a copy of this message | ||
First off it might be easier you threw all of those into an array - like this:
<INPUT TYPE="checkbox" NAME="boxes[]" VALUE="1">
Now for the other part if you have numbered them sequencially and you know the
nam of the variable you can do this:
<?
for($i = 0 ; $i < $number_of_checkboxes ; ++$i){
$var = 'prog_focus'.$n;
if(!isset($$var)){
$$var = '.';
}
}
?>
This uses the concept of variable variables.
--Joe
On Fri, Nov 17, 2000 at 11:26:09AM +0200, Gianni wrote:
> Hi I have a form for companies to fill out. Amongst other things, I have 18 checkboxes for
> different areas of service.
>
> I have called them prog_focus, prog_focus1 etc etc and the value would be Primary Education,
> Secondary Education etc etc.
>
> I would like to be able to fill in a '.' or soemthing in the db fields of the
> checkboxes not selected. How can I do that ?
>
> thanks
> Gianni
================================================================================
= Joe Stump joestump98@yahoo.com http://www.miester.org =
================================================================================
"Real programmers don't comment their code.
It was hard to write, it should be hard to understand."