[eluser]drakeonfire[/eluser]
Hello,
Essentially I'm trying to modify an item from the database in a form, the set_select works fine before form submittion (has the right field selected etc), but once the form has been posted it appears to stop working. I believe this is because it's comparing the supplied Integer in the set_select to the post value (which is a string as it's a post value).
I've tried strval, (string) etc on the integer but they don't work, even though my logic tests say they should.
Any idea on how to fix this?
My code for the set select is:
Code:
<option
value="<?php echo $cat->id; ?>"
<?php echo set_select(
'ca_sub_category',
$cat->id,
((!empty($original->sub_category) && $original->sub_category == $cat->id) ? TRUE : FALSE)); ?>
><?php echo $cat->title; ?></option>
(I tabbed it to make it easier to read, it's just in one block in my code).
Thanks.