473,569 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invoke code behind image-button with <Enter> key from anywhere on form

On my simple login-screen I have a 'username' and 'password' field and an
imagebutton for the 'OK'.

This used to work nicely so that when the user hit <Enter> from the password
field, it invoked the VB code behind the image-button, and away he went.
Suddenly this has stopped working like this. It still works if you use the
mouse to click on the button, or first TAB to it, then click <Enter>.
However, if you now hit <Enter> with the cursor still in the 'password'
field it submits the form, runs Page_Load, but doesn't call the
image-button's click event.

A 'working' version is at
http://www.mystictennisbookings.com/admin/login.aspx . FYI - what I did that
seemed to break it was to replace the Textbox webcontrol that I used for the
'Username' field with a Dropdown webcontrol.

Any ideas how I can restore the required functionality? Thanks,

Paul.
Nov 19 '05 #1
4 2172
So are using a DropDown webcontrol for the Username box on this page at
http://www.mystictennisbookings.com/admin/login.aspx ?

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #2
The link I sent is to the original version that works as desired - hitting
<Enter> from the password field here will invoke the code behind the
image-button.

There's a copy of the version that does NOT work at
http://www.mystictennisbookings.com/...est/login.aspx - here if you hit <Enter>
from the password field it submits the form but doesn't execute the
image-button event.

Paul.

Paul.
"Patrick Olurotimi Ige" <na********@hot mail.com> wrote in message
news:e$******** ******@TK2MSFTN GP09.phx.gbl...
So are using a DropDown webcontrol for the Username box on this page at
http://www.mystictennisbookings.com/admin/login.aspx ?

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #3


"Paul W" wrote:
On my simple login-screen I have a 'username' and 'password' field and an
imagebutton for the 'OK'.

This used to work nicely so that when the user hit <Enter> from the password
field, it invoked the VB code behind the image-button, and away he went.
Suddenly this has stopped working like this. It still works if you use the
mouse to click on the button, or first TAB to it, then click <Enter>.
However, if you now hit <Enter> with the cursor still in the 'password'
field it submits the form, runs Page_Load, but doesn't call the
image-button's click event.

A 'working' version is at
http://www.mystictennisbookings.com/admin/login.aspx . FYI - what I did that
seemed to break it was to replace the Textbox webcontrol that I used for the
'Username' field with a Dropdown webcontrol.

Any ideas how I can restore the required functionality? Thanks,

Paul.

Nov 19 '05 #4
Paul,

what you basically have to do is to assign a tiny js function to the keydown
event of your password input field which will trigger the ok.click.

HTHs

Daniel

"se-marten" <se*******@disc ussions.microso ft.com> schrieb im Newsbeitrag
news:2A******** *************** ***********@mic rosoft.com...


"Paul W" wrote:
On my simple login-screen I have a 'username' and 'password' field and an
imagebutton for the 'OK'.

This used to work nicely so that when the user hit <Enter> from the
password
field, it invoked the VB code behind the image-button, and away he went.
Suddenly this has stopped working like this. It still works if you use
the
mouse to click on the button, or first TAB to it, then click <Enter>.
However, if you now hit <Enter> with the cursor still in the 'password'
field it submits the form, runs Page_Load, but doesn't call the
image-button's click event.

A 'working' version is at
http://www.mystictennisbookings.com/admin/login.aspx . FYI - what I did
that
seemed to break it was to replace the Textbox webcontrol that I used for
the
'Username' field with a Dropdown webcontrol.

Any ideas how I can restore the required functionality? Thanks,

Paul.

Nov 19 '05 #5

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

Similar topics

3
3496
by: Robin S. | last post by:
I tried to ask this question several days ago, but I didn't explain my application correctly. Basically I want to have one record from table "A" and I want to display, say, 5 records from table "B" which are specified by the one record from table "A"... And all on the same form. I do not want to use a subform. The record fields from table...
5
23008
by: PD | last post by:
The TextChanged event is not being called when I hit the "Enter" key. Yet it does for the "Tab" key. I set a break point in the Page_Load event and the TextChanged event and none of these get called when I hit the 'Enter' key. After typing in letters in the textbox, if I hit the 'Tab' key or click outside the text box with my mouse, the event...
6
2122
by: Clark Sann | last post by:
Can someone help me understand what object should be used as the lock object? I've seen some programs that use Monitor.Enter(Me). Then, in those same programs, they sometimes use another object. Why? I would appreciate it if someone could help me understand the ramifications of picking an object in this command. Thank you so much for...
1
1086
by: YoMamaJoe | last post by:
I know how to make a mailto: link which has the subject, etc. But, how do I make a form which lets the user upload a file which would be an attatchment? I am planning on making an image upload website. So, I would want to limit the filetype to .jpg, .bmp, and .gif files which are less than 200kilobytes. Then, I when I recieve the message, I...
4
2109
by: MLH | last post by:
I seem to remember the code below working before. But, today, it is not. Instead, I get a 2450 error complaining that it cannot find the named form. This is true regardless of which form name I enter. Is perplexing. Private Sub ListControlsBttn_Click() Dim i As Integer, intHowmany As Integer, WhichForm As String Msg = "Enter form name."...
2
1303
by: Jaye | last post by:
Hi. I'm having some trouble with the code I'm using to validate a form. The form is used to query a database and users can enter multiple search criteria separated by commas. Since search criteria varies, some fields may be left blank, however, I want to prevent an empty form from being submitted. I have written the code, but it's not working....
2
2637
dlite922
by: dlite922 | last post by:
got the following code that works great in IE, i have need an exception to these rules. Why to Tab? Users come from old Apps (data entry people) and want to use the enter key to move through fields. Works fantastic, however i have a text area now that they can't enter blank lines (paragraph breaks) document.onkeydown =...
13
1830
by: DDragon | last post by:
ok here is the problem, i have to forms which have values i wish to be added together i can add together the values in one form all right but im having problems with adding the values of the other form to it... ill post the code for you to look at and try to explaine in detail what im trying to do. here is the code (HTML and Javascript so you...
9
1765
by: Hamayun Khan | last post by:
Hi I m using form like below <form action='' method = post> <input type=text name=txt id=txt> <select name=region id=region multiple> <option value=1>ONE</option> <option value=2>Two</option> <option value=3>Three</option> <option value=4>Four</option>
3
1903
by: bilalkhan | last post by:
Hello I m using MS Acces 2007, I need to create a form through which a user can enter all the parameter values in the form and these values will automatically picked by a query: Here is the query which i want to link with a form INSERT INTO ( , , , , , , , Cases, Premium, , ) SELECT ., ., ., ., ., ., ., .Cases, .Premium, ., . FROM
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.