<script>
<!--
function isValidAlert() {
for (var i = 0; i < document.alertF orm.length; i++) {
with (document.alert Form.elements[i]) {
if (.name == "text" || .name == "password" || .name == "textarea") {
if (.value == "") {
alert("Please enter a " + .name);
focus();
return false;
}
} else if (.name == "select-one") {
if (.options[document.alertF orm.elements[i].selectedIndex].value ==
"") {
alert("Please select a " + .name);
return false;
}
}
}
}
}
//-->
</script>
I don't know the answer to this problem, I am getting syntax errors, and
"with" does not search well on any Javascript tutorial. So this is my only
option for help; can someone tell me what I did wrong?
Thanx
Phil
<!--
function isValidAlert() {
for (var i = 0; i < document.alertF orm.length; i++) {
with (document.alert Form.elements[i]) {
if (.name == "text" || .name == "password" || .name == "textarea") {
if (.value == "") {
alert("Please enter a " + .name);
focus();
return false;
}
} else if (.name == "select-one") {
if (.options[document.alertF orm.elements[i].selectedIndex].value ==
"") {
alert("Please select a " + .name);
return false;
}
}
}
}
}
//-->
</script>
I don't know the answer to this problem, I am getting syntax errors, and
"with" does not search well on any Javascript tutorial. So this is my only
option for help; can someone tell me what I did wrong?
Thanx
Phil
Comment