You are viewing this page out of context. To see it in the context it is intended please click here.
About This Page
Reply posted by Mark Evans on Wed 1 Oct 2003 in response to Using the void operator in anchor links
Problems using anchor links
One problem you get if you use an anchor like that:i.e <a href="#" blah blah>
... is that if you have a long form, and you are doing validation or using
javascript to pop-up a child form, the anchor link will cause your form to
"jump" back up to the top of the form (it's looking for a bookmark labelled
"#") .. which might not be very convenient if the user was half-way down the
form filling something out.
You can set focus in your javascript function back to the field object that the
user was working on (if it's an object that can take a focus) .. but that
causes the form to jump around which is ugly.
Jake's suggestion to use a straight onclick="javascript:void yourfunction();"
in your href is better.