Hello,

I am having a hard time figuring this one out, maybe someone here (with
fresh eyes) can offer a suggestion?

Here is the function...

// Draw Checkbox Menu
function draw_checkbox_menu($name, $values, $default = false, $parameters =
false) {
    
    

    for ($i=0; $i<sizeof($values); $i++) {
        $field .= '<input type="checkbox" name="'.$name.'" value="' .
$values[$i]['id'] . '"';
        if(strstr($default, $values[$i]['id'])) {
            $field .= ' CHECKED';
        }
        $field .= '> ' . $values[$i]['text'] . '<br>
        ';
    }

    return $field;
}

This function is passed the name of the checkbox list($name), the values
that are available($values = array) along with the ones that should be
checked ($default). Parameters too , but not important.


The problem is this. The Values are formatted like this...

value1|value2|value3...etc...

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?

Thanks




+--------------------------------------------+
Mike Yrabedra 
[EMAIL PROTECTED] 
Your Mac Intelligence Resource
+--------------------------------------------+
W: http://www.macagent.com/
E: [EMAIL PROTECTED]

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

Reply via email to