Forum Moderators: open

Message Too Old, No Replies

script not working in firefox,

         

bobo

12:01 pm on Apr 27, 2007 (gmt 0)

10+ Year Member



can anyone help me out with this , when i try it with ie its working fine but, firefox is giving an error

Error: document.dine.elements is not a function
----------------
code below
-----------

<script language="javascript">

var str = 'mail.asp?action=go';
function mit(){

var mus = ['sl','fn','ln','EmailFrom','sr']

for (var i=0;i<mus.length;i++)
{

if (mus[i] == 'EmailFrom' && document.dine.elements(mus[i]).value!= "" ) {
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.dine.elements(mus[i]).value))) {
alert("The email you entered is not a valid email address.");
document.dine.elements(mus[i]).focus()
return

}
}

if (document.dine.elements(mus[i]).value == "")
{
alert("Please fill the Required feilds befor proceeding")
document.dine.elements(mus[i]).focus()

return

}

}
for (i=1;i<document.dine.length-2;i++){

str = str + '&' + document.dine.elements([i]).name + '=' + document.dine.elements([i]).value ;

}
getFile(str,raw);
}
</script>

bobo

1:41 pm on Apr 27, 2007 (gmt 0)

10+ Year Member



oki i got this solved

by adding a variable to the function
var t = document.getElementById('dine')[i]

and replacing all the referances with it