Can't set imagebutton to default button

Discussion in 'ASP .Net' started by =?Utf-8?B?QmlsbCBCb3Jn?=, Apr 27, 2005.

  1. Hello all,

    I have a standard-issue textbox to enter search words and an imagebutton to
    execute the search. When they press enter in the textbox I want it to click
    the button and run the server-side handler.

    Based on code I've seen out here and other articles, I can do this if the
    button is <input type=button>, by trapping the enter key in script and
    calling myButton.onclick from the textbox.

    But, I can't get this to work if the button is <input type=image>. I think
    it has to do with default submit behavior, but I'm not seeing it. I'm
    thinking too I might need to explicitly set the __eventtarget before the
    submit, but that isn't working either. Any thoughts?

    Thanks,

    Bill
     
    =?Utf-8?B?QmlsbCBCb3Jn?=, Apr 27, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?QmlsbCBCb3Jn?=

    David Young Guest

    Are you using Server side button or Client side?

    "Bill Borg" <> wrote in message
    news:...
    > Hello all,
    >
    > I have a standard-issue textbox to enter search words and an imagebutton

    to
    > execute the search. When they press enter in the textbox I want it to

    click
    > the button and run the server-side handler.
    >
    > Based on code I've seen out here and other articles, I can do this if the
    > button is <input type=button>, by trapping the enter key in script and
    > calling myButton.onclick from the textbox.
    >
    > But, I can't get this to work if the button is <input type=image>. I think
    > it has to do with default submit behavior, but I'm not seeing it. I'm
    > thinking too I might need to explicitly set the __eventtarget before the
    > submit, but that isn't working either. Any thoughts?
    >
    > Thanks,
    >
    > Bill
     
    David Young, Apr 27, 2005
    #2
    1. Advertising

  3. Server-side.

    "David Young" wrote:

    > Are you using Server side button or Client side?
    >
    > "Bill Borg" <> wrote in message
    > news:...
    > > Hello all,
    > >
    > > I have a standard-issue textbox to enter search words and an imagebutton

    > to
    > > execute the search. When they press enter in the textbox I want it to

    > click
    > > the button and run the server-side handler.
    > >
    > > Based on code I've seen out here and other articles, I can do this if the
    > > button is <input type=button>, by trapping the enter key in script and
    > > calling myButton.onclick from the textbox.
    > >
    > > But, I can't get this to work if the button is <input type=image>. I think
    > > it has to do with default submit behavior, but I'm not seeing it. I'm
    > > thinking too I might need to explicitly set the __eventtarget before the
    > > submit, but that isn't working either. Any thoughts?
    > >
    > > Thanks,
    > >
    > > Bill

    >
    >
    >
     
    =?Utf-8?B?QmlsbCBCb3Jn?=, Apr 28, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthias Marx

    HowTo Bind a Imagebutton as default

    Matthias Marx, Dec 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    327
    Matthias Marx
    Dec 3, 2003
  2. ad
    Replies:
    2
    Views:
    891
  3. MSDN
    Replies:
    0
    Views:
    376
  4. AlecL
    Replies:
    2
    Views:
    846
    Alexey Smirnov
    Feb 12, 2007
  5. SibAndela
    Replies:
    1
    Views:
    229
    Jeff Cochran
    Sep 26, 2004
Loading...

Share This Page