[thelist] javascript://

Cory Foy Cory.Foy at mindspring.com
Wed Jun 27 16:33:51 CDT 2001


> <snip>
> That was my guess as well.  In situations like this I typically will use
> HREF="#" OnClick="whatever();"
> </snip>
>
> The href="#" can cause problems... I remember encountering it a while back
> but can't remember why other than I had trouble with Netscape DOM vs IE.
> I solved it (with help from MonkeyJunkies) by doing
> <a href="JavaScript:submit()">Submit</a>
>

We always used <a href="javascript:void(0) onClick="yourFunction()">, and I
have not encountered any issues with it at all. Generally I do that, then
call a validating function which at the end submits the form. For example:

if(yourFormName == ""){
alert("This field can not be blank");
yourFormName.focus();
}else{
document.yourForm.submit();
}

It's basically the same thing. I would have to agree that, for accesibility
purposes, it is better to use an image that looks like text, but that just
MHO. Hope it helps!

Cory Foy
----------------------
Webmaster
Hillsborough County Information Technology
Phone: (813) 276-8287
Email: foyc at hillsboroughcounty.org
Web: www.hillsboroughcounty.org





More information about the thelist mailing list