Jump to content

Recommended Posts

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>
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by ezIQchad
WRONG
Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...