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

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

$config = array(
  'events/create_form' => array(
      'field'     => 'title',
      'label'     => 'Event name',
      'rules'     => 'required',

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

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?

[eluser]Evil Wizard[/eluser]
The input field works different to the text are field.
<input name="input_tag" type="text" value="my input value" />
<textarea name="textarea_tag" rows="8" cols="25" value="not the value of the the textarea">
this is the text value of the textarea input
what you would be better off doing in the textarea is
<textarea name="objective">
<?=set_value('objective','enter objective');?>
That will repopulate the textarea.

Theme © iAndrew 2016 - Forum software by © MyBB