JSFiddle - React, Tailwind, and code Playground
HTML
<input id="Textbox1" type="text"/>
<input type="button" value="Check" onclick="Check();">
JavaScript
function Check(){
val = document.getElementById("Textbox1").value;
val = val.split(',');
var is_Error = false;
var ErrrMsg = "All entries must be seven (7) characters in lenght. Please correct the following entries:\n";
for(var i=0;i<val.length;i++){
if((val[i].length !=7) && (val[i].length !=0)){
ErrrMsg += val[i] + ",";
is_Error = true;
}
}
if(is_Error == true){
alert(ErrrMsg.substring(0,(ErrrMsg.length - 1)));
return false;
}
return true;
}