[thelist] IE5 with href and onclick problem?

ben morrison morrison.ben at gmail.com
Wed Jun 7 08:54:54 CDT 2006


On 6/7/06, Stefan Schwarzer <st.schwarzer at geois.de> wrote:
> Until now everything worked well when I used the following command:
>
>         <a href="#" onclick="sendForm('23');" class="whitearrowright">next</a>
>
> But IE5 didn't seem to accept the "onclick" event for the link. It
> does work like this:
>
>         <a href="javascript: sendForm('23');" class="whitearrowright">next</a>
>
> I guess this is because the onlick event for the a-tag hasn't been
> implemented in that version of the browser. Or am I doing something
> wrong?

I haven't come across this before.

try a quick alert: <A HREF="somewhere.html" onClick="alert('I\'ve been
clicked!')">

However you are using Javascript incorrectly and users with javscript
off will not be able to send the form. A great article on the evolt
site by .jeff:

http://www.evolt.org/article/Links_and_JavaScript_Living_Together_in_Harmony/17/20938/

Ben



More information about the thelist mailing list