Setting the default button

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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
    Sean Guest

  2. Similar Questions and Discussions

    1. Setting default button in alertbox
      I'm using AVAlertWithParams to show a messagebox to the user. Is it possible to set the default button in the messagebox?
    2. Need help setting a default variable
      I have a query that results in one field for one unique record (Time_ID)...it is an integer. What I need to do is grab that one value at the...
    3. Setting index.cfm as the default document??? Yes, it hasbeen added as a default document in IIS.
      I am having trouble getting IIS to recognize the default index.cfm document, and I was wondering if anyone could give me some guidance. I created a...
    4. Faulty Default Setting
      Jerry, I disagree with your arguments strongly. Firstly, not all digital cameras 'deliver' 72 ppi images. Photoshop reads the EXIF data, and...
    5. Setting Default Font
      Stick to a known system font like arial or whatever or just use a shockwave font (can go a bit wonkey depending on the font) and change all your...
  3. #2

    Default 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:
    [url]http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18[/url]

    You could also try using this free control.
    [url]http://www.metabuilders.com/tools/DefaultButtons.aspx[/url]

    And here's a good article on the subject:
    [url]http://www.allasp.net/enterkey.aspx[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]

    "Sean" <nospam@> wrote in message news:uo4Bk35VDHA.452@TK2MSFTNGP10.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
    Steve C. Orr, MCSD Guest

  4. #3

    Default Re: Setting the default button

    Thank You Steve for those valuable links.


    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message news:#Kudz$5VDHA.2544@tk2msftngp13.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:
    [url]http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18[/url]

    You could also try using this free control.
    [url]http://www.metabuilders.com/tools/DefaultButtons.aspx[/url]

    And here's a good article on the subject:
    [url]http://www.allasp.net/enterkey.aspx[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]

    "Sean" <nospam@> wrote in message news:uo4Bk35VDHA.452@TK2MSFTNGP10.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
    Sean Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139