set focus to imagebutton / linkbutton

Posted on 2006-04-02
Last Modified: 2012-06-21
Hi ,

I was using javascript to set the focus of buttons on my page. It works fine, until I try it with linkbuttons and image buttons.

both document.forms(0).ctrlName.focus; and getelementbyid(ctrlName).focus work, but just not with imagebuttons or linkbuttons.

I know in 2.0, there is now a default button setting in the form, but that won't help me here.

Any ideas? thanks
Question by:Gezna
    LVL 4

    Accepted Solution

    LVL 7

    Expert Comment

    Set the "CausesValidation" Property of ImageButton to TRUE. This will work as Default Button/ImageButton


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now