RE: Drawing checkboxes

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

 



Mike <mailto:mike@xxxxxxxxxxxx>
    on Tuesday, December 07, 2004 12:11 PM said:

> I use the strstr() function to check against the $default so I can
> check it if so.
> 
> Well it works great..BUT, lets say the product has a category of
> "Coffee Pots", but the one of the values available is "Coffee".
> 
> In this case both "Coffee" AND "Coffee Pots" get checked when only
> "Coffee Pots" should.
> 
> What can I do to this function eliminate this?

don't look for merely the existence of "Coffee" but instead look for an
exact match.

Change:

>  if(strstr($default, $values[$i]['id'])) {
>    $field .= ' CHECKED';
>  }

Into:

if($default == $values[$i]['id']) {
  $field .= ' CHECKED';
}

??

That will work unless I'm not understanding how $default and
$values[$i]['id'] are defined.



hth,
Chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux