Results 1 to 3 of 3

Thread: No focus on page, when page loads

  1. #1
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question No focus on page, when page loads

    Hi, i'm using an xslt file that loads my page - which does not use a body.

    The problem i have is that everytime i open the page the focus is on the submit button. I don't really want that - where i just want no focus when the page opens up. I geuss a javascript is needed but i also dont have a body tag!

    Any ideas!

    Please assist!

    Regards

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You could try adding an event attribute to the submit button's tag:

    Code:
    onfocus="this.blur();this.onfocus=null;"
    Now, I know that adding attributes to tags in xml and xslt can be a bit different sometimes than in regular HTML, but it can be done, and sometimes it isn't (or doesn't need to be) any different than in HTML.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile Great!!! - Nice solution!

    Hi, Thank You very much - great solution!!!

    <xsl:attribute name="onfocus">this.blur(); this.onfocus=null;</xsl:attribute>

    This work's fantastically well!


    Thank You very much!!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •