嗨,我想将输入的文本值与csv文件的数据值进行比较,如果相等,请向我显示确认消息。我有这段代码。
<label>Product series number <button onclick="myValidation()">Validate!</button><span id="mensaje"></span><br>
<input type="number" name="numero_serie" id="mySerie" value="" size="40" placeholder="Write here!"></span></label>
function myValidation() {
var text;
var series = document.getElementById("mySerie").value;
switch(series) {
case "959189132":
case "2572331":
case "44265108":
text = "Validado";
document.getElementById("register").disabled = false;
break;
default:
text = "Número no valido";
document.getElementById("mySerie").value = "";
}
document.getElementById("mensaje").innerHTML = text;
}