Setting the default button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sean

    #1

    Setting the default button

    hi,

    i have a webform, which has a couple of formfields including a couple of buttons too.

    the webform structure is
    textbox1
    button1
    button2
    textbox2
    button3 - submit

    How do i trap when the focus on textbox2 , so i could set the enable property of button1 and button2 to be false, so the Submit would work, when the Enter Key is pressed.

    Any suggestion is welcomed and appreciated.

    --
    Thank You,
    Sean
  • Steve C. Orr, MCSD

    #2
    Re: Setting the default button

    You can intercept the client side enter keypress event of the text box and then click the correct button using javascript code.
    Here's a good example:


    You could also try using this free control.


    And here's a good article on the subject:


    --
    I hope this helps,
    Steve C. Orr, MCSD


    "Sean" <nospam@> wrote in message news:uo4Bk35VDH A.452@TK2MSFTNG P10.phx.gbl...
    hi,

    i have a webform, which has a couple of formfields including a couple of buttons too.

    the webform structure is
    textbox1
    button1
    button2
    textbox2
    button3 - submit

    How do i trap when the focus on textbox2 , so i could set the enable property of button1 and button2 to be false, so the Submit would work, when the Enter Key is pressed.

    Any suggestion is welcomed and appreciated.

    --
    Thank You,
    Sean

    Comment

    • Sean

      #3
      Re: Setting the default button

      Thank You Steve for those valuable links.


      "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message news:#Kudz$5VDH A.2544@tk2msftn gp13.phx.gbl...
      You can intercept the client side enter keypress event of the text box and then click the correct button using javascript code.
      Here's a good example:


      You could also try using this free control.


      And here's a good article on the subject:


      --
      I hope this helps,
      Steve C. Orr, MCSD


      "Sean" <nospam@> wrote in message news:uo4Bk35VDH A.452@TK2MSFTNG P10.phx.gbl...
      hi,

      i have a webform, which has a couple of formfields including a couple of buttons too.

      the webform structure is
      textbox1
      button1
      button2
      textbox2
      button3 - submit

      How do i trap when the focus on textbox2 , so i could set the enable property of button1 and button2 to be false, so the Submit would work, when the Enter Key is pressed.

      Any suggestion is welcomed and appreciated.

      --
      Thank You,
      Sean

      Comment

      Working...