Jump to content

Breaks in Emails


Recommended Posts

If the system does not respect the break lines, you can try to replace all the breaks with <br />.

Here is a sample code which can go to the footer of the submission page:

<script>
function f_txt(){ 
var str = document.getElementById('InsertRecordFIELDNAME').value; 
document.getElementById('InsertRecordFIELDNAME').value = str.replace(/n/g, <br />); 
} 
document.getElementById('caspioform').onsubmit=f_txt; 
</script>

***** Replace FIELDNAME with the actual field name. *****

Link to comment
Share on other sites

You can also add a rich text instead to your DataPage if your table has a text 64k field called "html_text". Your DP includes the field and form element is text area. These are the steps:

1. Place the following code in the DataPage header:

<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/assets/skins/sam/skin.css">
<!-- Utility Dependencies -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js"></script> 
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js"></script> 
<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
<script src="http://yui.yahooapis.com/2.5.2/build/container/container_core-min.js"></script>
<script src="http://yui.yahooapis.com/2.5.2/build/menu/menu-min.js"></script>
<script src="http://yui.yahooapis.com/2.5.2/build/button/button-min.js"></script>
<!-- Source file for Rich Text Editor-->
<script src="http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js"></script>

2. Place the following code in the DP footer:

<script>
window.onload = function() {
var myEditor = new YAHOO.widget.Editor('InsertRecordhtml_text', {
   height: '400px',
   width: '600px',
   dompath: true,
   animate: true 
		});
myEditor.render();				
document.getElementById("caspioform").onsubmit = function() {
					myEditor.saveHTML();

//var myHTML = myEditor.get('element').value;
				}
			}
</script>

3. Your webpage should have

<body class="yui-skin-sam">

4. The 'InsertRecordhtml_text' should be updated with your field name reference.

Link to comment
Share on other sites

  • 3 weeks later...

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...
 Share

×
×
  • Create New...