I have several input text boxes that are appended to a formula text field which includes a html table to be send to a word document with Exact Forms. Unfortunately, if any special characters such as < , ' etc. are added to the text input boxes, they are replaced with white space in the Word document. My initial thought was to use the URLEncode function on each text box, but then, when it is imported into Word, it is still encoded. Any thoughts on where to go from here? Is there a simple way to check for special characters and replace them with their Unicode or HTML counterparts?
QuickBase HTMLEncodes some special characters (ie "<", ">" etc) as a security precaution to prevent users from entering raw HTML that may be problematic.
You will need something like this code operating within the Exact Form to decode the HTML:
var encodedText = "<Foo Bar>";
var decodedText = $("<div/>").html(encodedText).text();
If you need individualized help fixing the problem fee free to contact me off-world using the information in my profile.
I guess my question goes further than that. Is there a way for me to check if a text input box contains any special characters, and find a way to replace them with their HTML counterparts? For example: a user inputs "Requested 10 units > than original request." This text field would break once imported into the html field because of the character ">". If I can find a way to search for all of those special characters, and replace them with html codes, prior to importing into the html field, then that would solve my problem. My alternate solution is to create a script and do some regex to find all of the characters, and replace them one by one, but I was looking for a Quickbase solution, if there was one.