Welcome Guest, Not a member yet? Register   Sign In
Form Helper - set_value()
#4

(This post was last modified: 08-30-2015, 09:26 AM by jLinux.)

So, oddly enough, this doesnt work actually

Edit: Maybe were using diff CI versions? But the code for set_value doesnt even look for _field_data, just looks right at $this->post

form_helper.php:
PHP Code:
<?php
if ( ! function_exists('set_value'))
{
 
   /**
     * Form Value
     *
     * Grabs a value from the POST array for the specified field so you can
     * re-populate an input field or textarea. If Form Validation
     * is active it retrieves the info from the validation class
     *
     * @param    string    $field        Field name
     * @param    string    $default    Default value
     * @param    bool    $html_escape    Whether to escape HTML special characters or not
     * @return    string
     */
 
   function set_value($field$default ''$html_escape TRUE)
 
   {
 
       $CI =& get_instance();

 
       $value = (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field))
 
           $CI->form_validation->set_value($field$default)
 
           $CI->input->post($fieldFALSE); // RIGHT HERE

 
       isset($value) OR $value $default;
 
       return ($html_escape) ? html_escape($value) : $value;
 
   }

Reply


Messages In This Thread
Form Helper - set_value() - by jLinux - 08-29-2015, 12:02 PM
RE: Form Helper - set_value() - by RobertSF - 08-29-2015, 04:03 PM
RE: Form Helper - set_value() - by jLinux - 08-29-2015, 07:10 PM
RE: Form Helper - set_value() - by jLinux - 08-30-2015, 09:16 AM
RE: Form Helper - set_value() - by jLinux - 08-30-2015, 09:36 AM
RE: Form Helper - set_value() - by RobertSF - 08-30-2015, 09:49 AM
RE: Form Helper - set_value() - by jLinux - 08-30-2015, 10:15 AM
RE: Form Helper - set_value() - by RobertSF - 08-30-2015, 10:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB