flosie0901 Posted February 9, 2016 Report Share Posted February 9, 2016 I have a form that can be for two separate but related cases. Based on the case selected, certain fields are or are not hidden. So in each case there is a section that does not apply. Is there a way to conditionally show parameters in the auto emails based on which radio button is checked? Essentially mimicking the rules of the form? Or, probably easier, is there an easy way to include it all in the email but hide any fields that are left blank? And not based on any checkbox, but simply if the field is blank, do not show it in the email. Also, I already am using this script for phone #s on the form, in case this affects anything.Thanks! <SCRIPT LANGUAGE="JavaScript"> function f_a(v_id) { return document.getElementById(v_id); } f_a('InsertRecordSchool_Contact_Phone').maxLength = 14; f_a('InsertRecordSchool_Contact_Phone').onkeyup = function(v_e) { v_e = v_e || window.event; if (v_e.keyCode >= 65 && v_e.keyCode <= 90){ this.value = this.value.substr(0, this.value.length - 1); return false; }else if (v_e.keyCode >= 37 && v_e.keyCode <= 40){ return true; } var v_value =(this.value.replace(/[^\d]/g, '')); if (v_value.length==7) { this.value = (v_value.substring(0,3) + "-" + v_value.substring(3,7));} else if(v_value.length==10){ this.value = ("(" + v_value.substring(0,3) + ") " + v_value.substring(3,6) + "-" + v_value.substring(6,10)); }; } </SCRIPT> Quote Link to comment Share on other sites More sharing options...
flosie0901 Posted February 9, 2016 Author Report Share Posted February 9, 2016 Actually this was a silly question, since I need it to not just hide the parameter such as [@field:Department] since that's technically blank anyway. But I have headers for all these, since it's needed. So I need it to hide the entire line: Department : [@field:Department] Really I need the emails to show some of the same things, but really it's two different email contents based on which radio button is checked. Any way to do this? I don't see any rules or conditionals for emails or posts about it. Quote Link to comment Share on other sites More sharing options...
LWSChad Posted February 10, 2016 Report Share Posted February 10, 2016 (edited) Email clients don't allow <style> .xyz{ style: value;} </style>, so this answer is wrong. Correct answer below You could add a style section to the email and use the examples from http://forums.caspio.com/index.php/topic/5501-conditional-formatting-trick/ <div class="some[@field:some]"></div> .some { display: none;} When field_some is blank .some will render the div not displayed Edited January 25, 2017 by ezIQchad WRONG Xiang 1 Quote Link to comment Share on other sites More sharing options...
flosie0901 Posted February 10, 2016 Author Report Share Posted February 10, 2016 Thanks, but...I am a nube at all this. Where specifically can I add this? Does it go into the style I am using and put it in there? If so where- what section of styles affects the emails? More specifics/directions would be super appreciated. Thank you! Quote Link to comment Share on other sites More sharing options...
flosie0901 Posted February 11, 2016 Author Report Share Posted February 11, 2016 I figured it out. Added as style item in email source. Thanks! Quote Link to comment Share on other sites More sharing options...
roattw Posted December 14, 2016 Report Share Posted December 14, 2016 I need to accomplish this but dont understand the solution. Quote Link to comment Share on other sites More sharing options...
LWSChad Posted January 25, 2017 Report Share Posted January 25, 2017 Email clients don't like style tags, so we must use inline styles. <span style="display: none[@param1]">[@param1]</span> If Param1 = null, then style="display: none" will render normally, thus hiding the span. If it's not null then it will be something that doesn't compute... like style="display: noneABCD", which won't hide the span Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.