I am new to asp.net. I have this code:
function onSubmitForm() {
var formDOMObj = document.frmSend;
if (formDOMObj.attach1.value == "" && formDOMObj.attach2.value == "" && formDOMObj.attach3.value == "" && formDOMObj.attach4.value == "" )
alert("Please press the Browse button and pick a file.")
else
return true;
var extension = lcase(right(formDOMObj.attach1.value,4);
if (extension == ".exe") || extension == ".html")
alert("Extension not allowed.")
return false;
}
I’d like to change it to allow only certain extensions instead of excluding them. I can do this by flipping the if but I’d like to change it to work with an array or list but I’m not sure how to do this…
Can someone help me by pointing me in the right direction?
You can use