You are viewing limited content. For full access, please sign in.

Question

Question

How to use SUBSTITUTE function in Forms Calculation to remove double quotes

asked on March 4, 2017 • Show version history

In Forms, I don't want to allow users to enter double quotes in a textarea field in a table. Since I can't stop them from entering the quotes, I'm trying to remove them when the user moves away from the field.

I'm trying to use the Substitute function in a Calculation, but I'm not having any luck. Is it possible to do this with a field Calculation, or do I need to resort to javascript?

Here's what I tried, among other variations:

=SUBSTITUTE(INDEX(My_Table.My_Field,ROW()), """", "")

Thanks!

 

0 0

Replies

replied on March 6, 2017 • Show version history

The calculation can not be used to calculate the field itself. You can use following JavaScript to do this:

$(document).ready(function(){
    $('textarea').blur(function(event) {
      var enteredText = $(this).val();
      var removeQuote =enteredText.replace(/["]/g,"");
       document.getElementById(event.target.id).value=removeQuote;
  
}); 
});

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.