Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] GRRR! set_select form validation failing on integer [SOLVED]
#1

[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="&lt;?php echo $cat-&gt;id; ?&gt;"
&lt;?php echo  set_select(
  'ca_sub_category',
  $cat->id,
  ((!empty($original->sub_category) && $original->sub_category == $cat->id) ? TRUE : FALSE)); ?&gt;
>&lt;?php echo $cat->title; ?&gt;</option>
(I tabbed it to make it easier to read, it's just in one block in my code).
Thanks.


Messages In This Thread
[SOLVED] GRRR! set_select form validation failing on integer [SOLVED] - by El Forum - 02-16-2012, 11:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB