K
kec
I want to create a script that prevent users of my form for typeing stupid
things.
Here is my script:
<script language="JavaScript" type="text/JavaScript">
<!--
function provjera(s1, s2, s3, s4) {
var ime1 = document.formular.ime;
var email1 = document.formular.email;
var mob1 = document.formular.mob;
var izbornik1 = document.formular.izbornik;
var obj1 = document.getElementById("s1");
var obj2 = document.getElementById("s2");
var obj3 = document.getElementById("s3");
var obj4 = document.getElementById("s4");
if (ime1.value.indexOf(" ") == -1) {
obj1.style.display = "block";
ime1.focus();
}
else obj1.style.display = "none";
if ((email1.value.indexOf("@") == -1) || (email1.value.indexOf(".") == -1))
{
obj2.style.display = "block";
email1.focus();
}
else obj2.style.display = "none";
if (mob1.length == 0) {
obj3.style.display = "block";
mob1.focus();
}
else obj3.style.display = "none";
if (izbornik1.selectedIndex == 0) {
obj4.style.display = "block";
izbornik1.focus();
} else {
obj4.style.display = "none";
document.formular.submit(); // Kaze da u ovom redu nesto ne valja
}
}
//-->
</script>
In Firefox it is good but Internet Explorer always want to debug.
He seys:
Line: 62
Error:Object doesn't support this property or method
Please Help m!!!!!
How I fix this??????????
things.
Here is my script:
<script language="JavaScript" type="text/JavaScript">
<!--
function provjera(s1, s2, s3, s4) {
var ime1 = document.formular.ime;
var email1 = document.formular.email;
var mob1 = document.formular.mob;
var izbornik1 = document.formular.izbornik;
var obj1 = document.getElementById("s1");
var obj2 = document.getElementById("s2");
var obj3 = document.getElementById("s3");
var obj4 = document.getElementById("s4");
if (ime1.value.indexOf(" ") == -1) {
obj1.style.display = "block";
ime1.focus();
}
else obj1.style.display = "none";
if ((email1.value.indexOf("@") == -1) || (email1.value.indexOf(".") == -1))
{
obj2.style.display = "block";
email1.focus();
}
else obj2.style.display = "none";
if (mob1.length == 0) {
obj3.style.display = "block";
mob1.focus();
}
else obj3.style.display = "none";
if (izbornik1.selectedIndex == 0) {
obj4.style.display = "block";
izbornik1.focus();
} else {
obj4.style.display = "none";
document.formular.submit(); // Kaze da u ovom redu nesto ne valja
}
}
//-->
</script>
In Firefox it is good but Internet Explorer always want to debug.
He seys:
Line: 62
Error:Object doesn't support this property or method
Please Help m!!!!!
How I fix this??????????