Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. First Selected Button

First Selected Button

Scheduled Pinned Locked Moved ASP.NET
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sroberts82
    wrote on last edited by
    #1

    Hi, I have a form with the following format: a the the top there are two buttons, followed by a text field, followed by a submit button. When I load the page, and press enter, nothing happens. When i select the text box and type stuff and press enter, the first button gets selected. The problem is this is a logout button. By default I want the submit button to be selected. I tried tabindex=1 on it but that didnt work. Any ideas? Thanks in advance,

    E 1 Reply Last reply
    0
    • S sroberts82

      Hi, I have a form with the following format: a the the top there are two buttons, followed by a text field, followed by a submit button. When I load the page, and press enter, nothing happens. When i select the text box and type stuff and press enter, the first button gets selected. The problem is this is a logout button. By default I want the submit button to be selected. I tried tabindex=1 on it but that didnt work. Any ideas? Thanks in advance,

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      Hi there, use js code to set focus to the control at page load.... just simply put this js code: getElementbyId("your_button_id").focus() into onload event in body tag of the form << >>

      S 1 Reply Last reply
      0
      • E enjoycrack

        Hi there, use js code to set focus to the control at page load.... just simply put this js code: getElementbyId("your_button_id").focus() into onload event in body tag of the form << >>

        S Offline
        S Offline
        sroberts82
        wrote on last edited by
        #3

        Nice one bruvver

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups