[thelist] dump question, but...

Michele Foster - WizarDev michele at wizardev.ca
Fri Jun 10 10:59:22 CDT 2005


----- Original Message ----- 
From: "Dan McCullough" <dan.mccullough at gmail.com>


> Its been awhile and I'm getting rusty.  I'm doing some redirecting
> back to a php form page, its a pretty long form so I dont want people
> to have to fill in all the stuff if they missed one thing or even 30
> things.  Anyway, I have a checkbox with about 9 items they can check,
> and I want that remembered, so I something like this.
>
> <input type="checkbox" name="housecond[]" value="1" <? if
> ($housecond=="1") print "checked" ?>>
>

Hi Dan,

You haven't actually said what's wrong ... so, here are some ideas.

What are the brackets doing in the name attribute?  That could be the
problem right there. The value being passed would then be housecond[]=1, and
not housecond=1.

Also, if all of your checkboxes are using the same name, then the string
being passed when submitted, probably looks something like,
housecond[]=1,3,5.  In which case, you will either have to split that into
an array in order to get the single values (I don't do it this way), or
check if the value is in the string.  In ASP, it's the instr function .. I
don't know what it would be in PHP.

If I'm way off base, perhaps more info is needed.  :)

Mich




More information about the thelist mailing list