By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,434 Members | 2,902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,434 IT Pros & Developers. It's quick & easy.

Loose Focus/no Focus onclick set focus to nothing/opening a page where there is none!

100+
P: 200
Hi, I would like to do the following.

I have an href where onclick the focus is on the href:
I got it to change focus to another object but i don't really want that.

It must be as if the user clicked nothing. The href is what i use for my tooltip so it's only surppose to work onmouseover!

This is the jscript:
onClick="document.getElementById('__Submit').focus();"

The __Submit' is another object - i' setting the focus to


XSLT code i'm using:

Expand|Select|Wrap|Line Numbers
  1. <a>         
  2. <xsl:attribute name='href'>#</xsl:attribute>
  3. <xsl:attribute name='rel'>ttip_<xsl:value-of select='@name' /></xsl:attribute>
  4. <xsl:attribute name='onClick'>document.getElementById('__Submit').focus();</xsl:attribute>
  5.  <img src="images/help.jpg" align="texttop" style='border : none;'></img>
  6. </a>
  7.  
Please Help!

Regards
Jan 19 '08 #1
Share this Question
Share on Google+
2 Replies


100+
P: 200
I found that i had to add the onBlur as it did not work without that!

code:
Expand|Select|Wrap|Line Numbers
  1. <a style="outline-style:none; cursor:default;">
  2. <xsl:attribute name='href'>#</xsl:attribute>
  3. <xsl:attribute name='rel'>ttip_<xsl:value-of select='@name' /></xsl:attribute>
  4. <xsl:attribute name='onClick'>this.blur();return false;</xsl:attribute> 
  5. <img src="images/help.jpg" align="texttop" border="0" style='border : none; cursor:default; outline-style:none;'></img>
  6. </a>

Regards
Jan 21 '08 #2

acoder
Expert Mod 15k+
P: 16,027
Thanks for posting the solution. Just wondering, though, why you need this behaviour.

Please remember to use code tags when posting code. Thanks!
Jan 21 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.