473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Can't set imagebutton to default button

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
Nov 19 '05 #1
2 1431
Are you using Server side button or Client side?

"Bill Borg" <Bi******@discussions.microsoft.com> wrote in message
news:4A**********************************@microsof t.com...
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

Nov 19 '05 #2
Server-side.

"David Young" wrote:
Are you using Server side button or Client side?

"Bill Borg" <Bi******@discussions.microsoft.com> wrote in message
news:4A**********************************@microsof t.com...
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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Christian Ista | last post by:
Hello, I have a database, a simple table called "FAQ" in this table 3 fields "ID", "QUESTION" and "ANSWER". I'd like for all record return by a query display the question next to an...
2
by: Chuck Hartman | last post by:
I've been trying to add an ImageButton object to a Calendar table cell, but so far I am unable to handle the Command event from that button in my form's code behind. Below is an example of what I...
2
by: David Hearn | last post by:
I have an ImageButton control that I am using on one of my pages. Sometimes, this button will act as a button and redirect users to another page. But sometimes, it will just act as an image...
6
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically...
3
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, ...
13
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif"...
2
by: Bendik Engebretsen | last post by:
I'm an ASP newbie and have just started experimenting with ASP.NET 2.0 using the VS.NET 2005 Beta. As a starting point I have used the 'Personal WEB site' starter kit. I am now trying to figure...
2
by: ad | last post by:
I have a Button (named btnOK) and a ImageButton (named ImageButton1) in a Template field of a GridView; I use the codes below to find the Button and ImageButton, the ImageButton can be found,...
4
by: Benny Ng | last post by:
Dear All, <input type="checkbox" name="chkAgreement" value="0">I agree with the above terms and conditions <asp:ImageButton ID="ImgBtnSubmit" Runat="server" CausesValidation=True...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.