[thelist] Netscape - Form onSubmit with Image problem
Jagjeet Hayer
Jagjeet.Hayer at softwareag.co.uk
Tue May 30 10:39:51 2000
Hi everyone,
I have a slight Netscape problem.
I have a form with some fields and an input of type image which when clicked
will submit the form. This is fine in IE but not in Netscape. The image no
longer swaps and doesn't submit.
---------------------------------------------
function MM_swapImgRestore()
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}
function MM_swapImage()
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
function checkFields()
{
if(!allValid())
{
return false;
}
else
{
document.regform.submit();
}
}
<BODY>
<FORM action="/servlet/registration1" method=post id=regform name=regform
onsubmit="return checkFields()">
<table>
<some fields>
<input type="image" onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('Image2','','../images/main/gifs/mortappconton.gif
',1)"
name="Image2" border="0"
src="../images/main/gifs/mortappcontoff.gif"
width="94" height="23" alt="Continue">
</table>
</body>
------------------------------------------
I don't really know the ins and outs of Netscape so I would appreciate if
anyone could shed some light on this.
Thanks,
Jag.