Jump to content

[FYI] Removing HTML tags to data inputs using RICH text editor using JavaScript

Recommended Posts

I found another solution in removing HTML tags in the data saved in Rich text editor. This is more if an alternative to this solution. Specially for those who doesn't have access to Triggered action.

  1. First you would need another field in your table that will store the plain text version of the actual input.
  2. Put that field in your Submission form and add a HEADER and FOOTER in your DataPage.
  3. Go the the FOOTER of your DataPage and disable the HTML editor in the Advanced tab.
  4. Paste the code below in your footer:


<script type="text/javascript">

//This will hide the field for the "plain" text
var non_formatted_txt = document.querySelector("#InsertRecordFIELDNAME_2");
non_formatted_txt.style.display = "none";

document.addEventListener('BeforeFormSubmit', function(event) {

//This will replace all the HTML tags with blank
var input = document.querySelector("#InsertRecordFIELDNAME_1").value.replace(/<\/?[^>]+(>|$)/g, "");

non_formatted_txt.value = input;

NOTE: replace FIELDNAME_2 with the actual fieldname of your field for the "plain" text and replace FIELDNAME_1 with the actual field name of the rich text editor field.

Sample input :


Actual table value:


Non formatted value:




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.

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.

  • Create New...