PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Urldecode before displaying text field value

  1. kevinfilteau
    Member

    I have a form like that post (get method) to my gravity form to prepropulate it.

    I have a field like this one.
    <input type="hidden" value="---urlencoded text with new line, frech chars, etc.---" />

    That prepopulate a paragraph text field. But when it does, the displayed text is still rendered as urlencoded. How can I make the text displayed urldecoded?

    Thanks

    Posted 13 years ago on Tuesday September 6, 2011 | Permalink
  2. kevinfilteau
    Member

    I temporally hacked the code in form_models.php. I added a url decoding function to the value get to prepopulate the field. Waiting for a better way, or an integrated way that will not be lost on an update. Thanks

    private static function get_input_value($field, $standard_name, $custom_name = "", $field_values=array(), $get_from_post=true){
            if(!empty($_POST["is_submit_" . rgar($field,"formId")]) && $get_from_post){
                $value = RGForms::post($standard_name);
                if(!is_array($value))
                    $value = stripslashes($value);
    
                return $value;
            }
            else if(rgar($field, "allowsPrepopulate")){
    >>>>>            return urldecode(self::get_parameter_value($custom_name, $field_values));
            }
        }
    Posted 13 years ago on Tuesday September 6, 2011 | Permalink