How to remove a quote from a text field

Hi,

I have a notes web based application and I have an issue when customers input " in the Title description like this “This is a description”, making the document not visible in the view through web, if I go to the view through notes client I can find the document.

If I delete the " manually the document is visible on the web.

I would like to find a way to validate this, do you have any ideas?

Thanks :slight_smile:

Sunny

Subject: Easiest way to do this

Hi, Sunny. The easiest way to do this would be to use @ReplaceSubstring in the input translation formula for this description field. So in other words, use something like @ReplaceSubstring(;“"”;“”) as the input translation formula for the field. I just tried it in a simple web app and it works great. You will notice that you have to use the backslash escape character in the formula to indicate that you want the literal double quote as the character you want replaced.

Subject: How I solved it

Hi, I finally could solve as follows:In the OnClick event for the Field on the form put this javascript:

var frm = document.forms[0];

var word1 = getFieldValue(frm.Field);

var quote = "\"";

var word2 = "";

var len = word1.length;



for (var i=0; i < len+1;i++)

	{

		var caracter=mid(word1,i,1);

		if (caracter != "\"")

			{

				word2 = word2 + caracter;

			}	

	}

frm.Field.value=word2;

Subject: onBlur()

Since it is a web application, one way to solve it is to put some Javascript in the onBlur event of the field.

Or you could put code in WebQuerySave() to perform a replace of the quote.

Subject: RE: How to remove a quote from a text field

Hi, Thanks for your response, my question is, how can I validate the field contains double quotes and replace for a blank space ?

Thanks :slight_smile:

Subject: .replace()

Did you even search for “javascript replace”?

But using a validation formula as Dave suggests is the quickest and cleanest way.