Re: Dealing with Unchecked Checkboxes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Unchecked checkboxed do not return a value. They don't return a NULL or 
empty string or anything. So what you have to do is check to see if the 
variable is set. If it is set, then it's checked, if it's not set, then 
it's unchecked.

Kinda sucks if your variable names are dynamic, I just erase the whole 
record and re-insert in that case.

-Micah


At 09:02 PM 10/26/2002 +0100, Graeme McLaren wrote:
>Hey all, I'm trying to get my head around checkboxes.  I can insert 
>"checked" checkboxes into a DB no problem but I get an error when the 
>checkboxes are unchecked.  I've used the following to try and handle 
>unchecked checkboxes but I still get the error "query was empty" can 
>anyone point me in the right direction?
>
>
>$number=count($GiftWrapping);
>  for($a=0;$a<$number;$a++)
>{
>      echo $GiftWrapping[$a];
>  if ( empty( $GiftWrapping ) )
>  {
>  $GW = 'N';
>  }
>
>INSERT INTO DB CODE HERE
>
>GiftWrapping = '$GW'";
>
>}
>
>
>Cheers in advance,
>
>Graeme :)
>
>
>Public Sub House()
>
>On Error Resume drink
>
>          If Pint.empty = True Then
>                  Pint.refill
>    Else
>                  Pint.drink
>          End if
>
>stomach.add Pint
>
>MsgBox " I've had .... " & stomach.count & " Pints"
>MsgBox "VERY DRUNK"
>
>End Sub

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux