validation for two select box using array [closed]

one way using jQuery

function validate(){
    var key = $("#select-key").val(),
        val = $("#select-value").val();
    return key in a && a[key] == val;
}

Assuming a is your array and your select boxes have the IDs select-key and select-value respectively.
Hope this helps.

Leave a Comment