Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #504268

    Hi, when using the “Contact” content element, we’ve noticed that when the form is submitted, the email received shows the checkboxes as “true” when selected and “false” when not selected. Is there a way for me to change that wording to simply “yes” or “no?”

    Thanks so much – favorite theme by far!

    #504412

    Hey imagestudios!

    can u give us test access so we can check your form?

    Cheers!
    Basilis

    #508748

    Sorry for the delay. Yes, I’ve provided that below as private.

    #509348

    Hi,

    Open /framework/php/class-form-generator.php and look for:

    			if(empty($_POST[$id])) $_POST[$id] = "false";
    
    			$this->elements_html .= "<p class='".$p_class.$element['class']."' id='element_$id'>";
    			$this->elements_html .= '    <input '.$checked.' name="'.$id.'" class="input_checkbox '.$element_class.'" type="checkbox" id="'.$id.'" value="true"/><label class="input_checkbox_label" for="'.$id.'">'.$element['label'].$required.'</label>';
    			$this->elements_html .= "</p>";
    

    Replace it by this:

    			if(empty($_POST[$id])) $_POST[$id] = "no";
    
    			$this->elements_html .= "<p class='".$p_class.$element['class']."' id='element_$id'>";
    			$this->elements_html .= '    <input '.$checked.' name="'.$id.'" class="input_checkbox '.$element_class.'" type="checkbox" id="'.$id.'" value="yes"/><label class="input_checkbox_label" for="'.$id.'">'.$element['label'].$required.'</label>';
    			$this->elements_html .= "</p>";

    Regards,
    Josue

    #514657

    Hi, I did incorporate that code. It does say “no” where it used to say “false,” but the “true” areas still say true. Also, in testing, I noticed that some checkboxes I selected said “false” which was probably an issue before we revised this code. Is that a bug?

    Thanks for your insight!

    #514659

    I also noticed that on the form: I can’t always select every radio button that I’d like. Please try to select all buttons and see if it works for you (I’m using Safari): http://www.principlesforliving.org/contact/

    #514836

    Hi!

    Try it now, i’ve modified the file on your install.

    Regarding the radio select issue, that’s a known bug and it’s caused by the similarity of the labels, it will get fixed if you the wording at the start of one of them – http://screencast.com/t/i1KByTVBHJid.

    Cheers!
    Josue

    #526836

    Hi, we’ve tested and still receiving “true” instead of “yes.” It’s a minor issue, but one we’d like to fix. Here’s what I received:

    Please mail me this month’s FREE PFL booklet.: no
    I would like information about the orphanages that Principles for Living serves.: true
    Please send me information about the pastor training in Kenya and Liberia.: no
    Other (please tell us below): no

    Thanks again for your help!

    #527185

    Hey!

    Discard editing the class-form-generator.php file, try adding this code to your theme / child theme functions.php:

    add_filter('avf_form_mail_field_values', 'avia_change_checkbox_return_values', 10, 4);
    function avia_change_checkbox_return_values($value, $new_post, $form_elements, $form_params){
    if($value == 'false') $value = 'No';
    if($value == 'true') $value = 'Yes';
    return $value;
    }

    Regards,
    Josue

    #527522

    Thanks Josue. They are still showing true and false. Even the test you did showed that. Any other thoughts?

    #527725

    Try it now.

    #1289697

    Hello.
    I have the same problem.
    I followed all the steps – and got to the part when you solved the problem “off-line” – so I still have not found the solution.

    Could you tell me how to change the wording pls?
    thanks
    Kim

    #1290765

    Hi,
    Sorry but this solution will not work, it is from 2015 and the elements are not the same. The easiest solution for you would be to use the Say what? plugin or change the language file with Poedit
    If you find that you need further assistance with this then please open a new thread, thank you.

    Best regards,
    Mike

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Contact Form — Change Response Wording of "False" and "True"’ is closed to new replies.