I am trying to refresh the page after 3 seconds if two text boxes are not filled with text.
I have it set to a button, it works fine without the conditions.
function refresh() {
var txt1 = document.getElementById("txtAccountNumber");
var txt2 = document.getElementById("txtStaffNumber");
if (txt1.value == "" && txt2.value == "") {
setTimeout(function() {
location.reload();
}, 3000);
}
}
if (txt1.value.trim() === "" && txt2.value.trim() === "") setTimeout(location.reload, 3000);!txt1.value && !txt2.valueinstead. My assumption is.valuereturns undefinedI have it set to a button, it works fine without the conditions?