Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Can't set imagebutton to default button

Reply
Thread Tools

Can't set imagebutton to default button

 
 
=?Utf-8?B?QmlsbCBCb3Jn?=
Guest
Posts: n/a
 
      04-27-2005
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
 
Reply With Quote
 
 
 
 
David Young
Guest
Posts: n/a
 
      04-27-2005
Are you using Server side button or Client side?

"Bill Borg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmlsbCBCb3Jn?=
Guest
Posts: n/a
 
      04-28-2005
Server-side.

"David Young" wrote:

> Are you using Server side button or Client side?
>
> "Bill Borg" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set a button from a user control the default button on an aspx page AlecL ASP .Net 2 02-12-2007 09:15 PM
How to NOT have an ImageButton be the Default button MSDN ASP .Net 0 04-19-2006 05:16 PM
Changing image on an ImageButton makes by button disappear abarberis@gmail.com ASP .Net 2 01-11-2005 10:04 PM
Set cursor in first text box and set button as default SibAndela ASP General 1 09-26-2004 06:31 PM
HowTo Bind a Imagebutton as default Matthias Marx ASP .Net 0 12-03-2003 02:10 PM



Advertisments