Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call Javascript function in Mac ie browser 1

Status
Not open for further replies.

n2ckb

Programmer
Jun 8, 2001
65
GB
Hi guys,

I have a website that works fine in the PC version of IE. To avoid Netscape problems of onclick events with images I have used a href link to a javascript function. It does not appear to work with the Mac version of IE Does anyone know of the correct syntax to make a form submit on an href using a javascript function that is Mac and PC compatible?

Thanks in advance, any help is much appreciated!

shown below is my test page that doesn't work either...

<HTML>

<HEAD>
</HEAD>
<SCRIPT LANGUAGE=javascript>
function mactest()
{
document.maccheck.submit();
}
</SCRIPT>

<BODY>
<FORM method = &quot;post&quot; name = &quot;maccheck&quot; id = &quot;maccheck&quot; action = &quot;pageworked.asp&quot;>
<a href = &quot;mactest.asp&quot; onclick =&quot;mactest(); return false;&quot;><img src = &quot;clickme.jpg&quot;></A>
</FORM>
</BODY>


</HTML>
 

If you remove the 'id=&quot;maccheck&quot;' and 'return(false);', the codes works:

Code:
<HTML>

<HEAD>
</HEAD>
<SCRIPT LANGUAGE=javascript>
function mactest()
{
document.maccheck.submit();
}
</SCRIPT>

<BODY>
<FORM method = &quot;post&quot; name = &quot;maccheck&quot;action = &quot;pageworked.asp&quot;>
    <a href = &quot;mactest.asp&quot; onclick =&quot;mactest();&quot;><img src = &quot;clickme.jpg&quot;></A>
</FORM>
</BODY>


</HTML>

Hope this helps!

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top