Welcome Guest, Not a member yet? Register   Sign In
Has anyone notices any bug with FormValidator
#1

[eluser]bibstha[/eluser]
I've been spending quite some time with set_value error in CodeIgniter.

In my config/form_validation.php file
i've set the $config variable as

Code:
<?php
$config = array(
  'events/create_form' => array(
    array(
      'field'     => 'title',
      'label'     => 'Event name',
      'rules'     => 'required',
    )
  ),
);
?>

Now the actual form which contains the textarea title has other field objective.
Code:
<form >
  <?php print form_input('title',set_value('title','enter name')); ?>
  <?php print form_textarea('objective',set_value('objective','enter objective')); ?>
</form>

Now on invalid error, title is populated from the $_POST while objective isn't. Sad

I looked through the source and found out that when form_validation is loaded, it actually calls
class CI_Form_validation:Confusedet_value(). But CI_Form_validation:Confusedet_value only works for values already in the validation $config variable.

So the code is returning empty text.

Can anyone confirm this as a bug? Or am I missing some part?


Messages In This Thread
Has anyone notices any bug with FormValidator - by El Forum - 05-22-2009, 05:50 AM
Has anyone notices any bug with FormValidator - by El Forum - 05-22-2009, 07:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB