Tagged: change, contact, CONTACT FORM
-
AuthorPosts
-
September 16, 2015 at 4:32 pm #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!
September 16, 2015 at 10:02 pm #504412Hey imagestudios!
can u give us test access so we can check your form?
Cheers!
BasilisSeptember 25, 2015 at 4:49 am #508748Sorry for the delay. Yes, I’ve provided that below as private.
September 26, 2015 at 5:52 am #509348Hi,
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,
JosueOctober 6, 2015 at 6:13 pm #514657Hi, 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!
October 6, 2015 at 6:15 pm #514659I 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/
October 6, 2015 at 11:26 pm #514836Hi!
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!
JosueOctober 29, 2015 at 3:18 pm #526836Hi, 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): noThanks again for your help!
October 29, 2015 at 10:42 pm #527185Hey!
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,
JosueOctober 30, 2015 at 4:22 pm #527522Thanks Josue. They are still showing true and false. Even the test you did showed that. Any other thoughts?
October 30, 2015 at 10:25 pm #527725Try it now.
March 22, 2021 at 7:57 pm #1289697Hello.
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
KimMarch 27, 2021 at 8:13 pm #1290765Hi,
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 -
AuthorPosts
- The topic ‘Contact Form — Change Response Wording of "False" and "True"’ is closed to new replies.