We have a function that validates a form and then does submit (and a bunch of other stuff)
We called it using:
<a href="#" OnClick="MyFunction();" title="Save changes and continue">SAVE</a>
This worked fine on the browsers we were using (IE6 in the main), but we now find doesn't work on IE5.01, Mac and some others.
OK, so having done some research I now realise I needed RETURN FALSE in OnClick.
So ... faced with having to change a lot of pages I'd like to have the best possible syntax (by which I suppose I rellay mean most-browser-compatible
), and I've seen a number of options; advice on picking a good'un would be much appreciated.
Amongst the stuff I've seen is:
1. href="#" onclick="MyFunction();return false;"
2. href="#null" onclick="MyFunction();return false;"
4. href="#" onclick="return MyFunction();"
What about what shows in the Status bar? Should I have an OnMouseOver event too to describe what MyFunction is going to do? Rather than displaying a meaningless link.
Anything else to note? (This function is part of a library being reused for major web site development over the next however many years, and not for single-project build-and-throw-away, so all possible functionality, including The Kitchen Sink!, is up for consideration).