dandaman209
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form 7] Embed if/else Statement Within Message BodyI found the link below. Not sure if it can be tweaked to fit my specifications.
https://www.pinwire.com/sci-tech/contact-form-7-conditional-form/
Thanks again.
Forum: Plugins
In reply to: [Contact Form 7] Embed if/else Statement Within Message BodyYes, I did. And it rendered in the email as you explained it would.
I don’t think I was clear in my previous post. I am talking about hiding and showing the actual field from the form. If the user selects the “Yes” radio button the element “2nd recipient” will appear on the form, and if “No” it will stay hidden from the user. I was able to initially have the field hidden, but my issue is getting it to reappear if/when the user answers “Yes”.
Below is the function I used. But I need have work for a radio button as opposed to a list.
/*! jQuery script to hide certain form fields */ $(document).ready(function() { //Hide the field initially $("#hide1").hide(); //Show the text field only when the third option is chosen - this doesn't $('#awesome').change(function() { if ($("#awesome").val() == "Nope") { $("#hide1").show(); } else { $("#hide1").hide(); } }); });
In the forum there was a link to a jquery script for a radio button. But how do you check for a boolean in cf7?
HTML code:
`<input type=”radio” name=”lang_anz” value=”1″> Yes<br>
<input type=”radio” name=”lang_anz” value=”0″ checked=”checked”> No<br>
<div id=”div_name”>Some text in div.</div>`Jquery script:
`$(document).ready(function(){
$(“:radio:eq(0)”).click(function(){
$(“#div_name”).show(1000);
});$(“:radio:eq(1)”).click(function(){
$(“#div_name”).hide(1000);
});});`
Forum: Plugins
In reply to: [Contact Form 7] Embed if/else Statement Within Message BodyWow!! that worked. Thank you kylee6114! Your awesome ??
I have another question now that kylee6114 has enlightened me to this unconventional way of solving my issue.
In kylee6114’s example I found a way to hide “2nd recipient” from the user. What I would like is that, if the user answers “Yes” the “2nd recipient” placeholder should appear. And if the user answers “No” (or maybe… if they don’t answer at all) the “2nd recipient” placeholder should not appear at all.
I found this forum that explains how to hide/show elements on a page. But using the [select] (drop down) option. I tried tweaking the function to have the placeholder appear when the user clicks the “Yes” radio button but to no avail. I am not sure how to do a boolean check for cf7’s radio button. See link below for show/hide tutorial.
Thanks Guys!