Assuming the string “N/A” is without anything leading or tailing you can do the following
var na = contentOfYourTextbox;
if(!na.match(/^N\s*[/]\s*A$/)){
alert("I'm sorry, Dave. I'm afraid I can't do that.");
} else {
// do whatever you have plannned to do when the user entered "N/A"
}
2
solved Javascript validation error not valid value N/A [closed]