Update system/libraries/Form_validation.php #947

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

dionysiosarvanitis commented Jan 20, 2012

Problems with repopulating fields if form_validation is loaded (Issue #104)

If you do not specifiy a rule in the form validation, set_value in form_helper.php returns empty or sets default value for that field, instead of the postdata.

system/libraries/Form_validation.php
{
- return $default;
+ if( $this->CI->input->post($field)===FALSE)
@philsturgeon

philsturgeon Jan 20, 2012

Contributor

Could you please follow the style guide for spacing, tabs and if statements?

http://codeigniter.com/user_guide/general/styleguide.html

Thank you! :)

@dionysiosarvanitis

dionysiosarvanitis Jan 20, 2012

Contributor

I'm trying !

system/libraries/Form_validation.php
{
- return $default;
+ if ( $this->CI->input->post($field) === FALSE)
@philsturgeon

philsturgeon Jan 20, 2012

Contributor

Sorry dude but it's if ($this....

system/libraries/Form_validation.php
+ $field = $this->CI->input->post($field);
+ }
+ else
+ {
@philsturgeon

philsturgeon Jan 20, 2012

Contributor

Also spacing here looks pretty whack.

@dionysiosarvanitis

dionysiosarvanitis Jan 20, 2012

Contributor

I think it's ok now!
there were some spaces in front, causing the problem.

thanks for the advice.

@narfbg narfbg closed this Nov 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment