如何比较输入文本值和csv文件的数据值

时间:2018-06-19 15:26:21

标签: javascript jquery html arrays csv

嗨,我想将输入的文本值与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;

}

0 个答案:

没有答案