This code wants to check an array if the name is in it or not, and that the first letter of all the names in the array is uppercase. There are many users who write their name without using an uppercase letter in their first name.
So I want to pass this condition in the code, by Regular Expression ( /i ), I can use this with a string and some other functions, but I can't use it with a variable.
Can anybody help me?
function runTest() {
"use strict";
var value = document.getElementById("inin").value;
if (names.indexOf(value) > -1) {
x.innerHTML = "yes " + value + " your name is here, your are fully approved";
} else {
x.innerHTML = "Sorry, Your name isn't here";
}
}