I'm working on a validation script, but I'm running into a very particular issue.
If a user enters a string that happens to be an encoded html character (like & or &), it will output as the character (& in this case). My question is this: is it possible to write a function that detemines if a string is an encoded character? So if the user enters one of the two above options, I want to launch a particular function, and if it's a non-encoded character, I want to do something else.
Is there a way to do this?
if (/&|&/.test(strVar)) { ... }