473,396 Members | 1,933 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,396 software developers and data experts.

Raise event when leaving Textbox

Is there a way to raise an event when a user exits a textbox?

I tried OnTextChanged and that doesn't seem to do it.

<asp:textbox id="email" TextMode="SingleLine" OnTextChanged="checkRecords"
Columns="45" runat="server" />

I need to load a dropdownlist after someone enters his email. There would
be no button to push. After the user enters his name and email it needs to
check a table to see if there are already any record and if so load the
dropdown to all the user to choose one.

Thanks,

Tom.
Nov 19 '05 #1
2 4115
Hi Tom,

Don't forget autopostback="True":

<asp:textbox id="email" TextMode="SingleLine"
OnTextChanged="checkRecords" Columns="45" runat="server"
autopostback="True" />

Public Sub checkRecords(ByVal sender As Object, ByVal e As
System.EventArgs)
Response.Write("Checking records here for " & email.Text)
End Sub

Ken
MVP [ASP.NET]
Toronto

"tshad" <ts**********@ftsolutions.com> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Is there a way to raise an event when a user exits a textbox?

I tried OnTextChanged and that doesn't seem to do it.

<asp:textbox id="email" TextMode="SingleLine"
OnTextChanged="checkRecords" Columns="45" runat="server" />

I need to load a dropdownlist after someone enters his email. There would
be no button to push. After the user enters his name and email it needs
to check a table to see if there are already any record and if so load the
dropdown to all the user to choose one.

Thanks,

Tom.


Nov 19 '05 #2
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:ul**************@TK2MSFTNGP09.phx.gbl...
Hi Tom,

Don't forget autopostback="True":
I did forget that.

It worked.

I have a similar problem with the dropdownlist.

If I make a selection (which may be the one already showing), how can I jump
to function as he makes a choice?

I can use OnSelectedIndexChanged, as the index may not change.

Would I use autopostback here also? If so, what event should I use?

Thanks,

Tom.
<asp:textbox id="email" TextMode="SingleLine"
OnTextChanged="checkRecords" Columns="45" runat="server"
autopostback="True" />

Public Sub checkRecords(ByVal sender As Object, ByVal e As
System.EventArgs)
Response.Write("Checking records here for " & email.Text)
End Sub

Ken
MVP [ASP.NET]
Toronto

"tshad" <ts**********@ftsolutions.com> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Is there a way to raise an event when a user exits a textbox?

I tried OnTextChanged and that doesn't seem to do it.

<asp:textbox id="email" TextMode="SingleLine"
OnTextChanged="checkRecords" Columns="45" runat="server" />

I need to load a dropdownlist after someone enters his email. There
would be no button to push. After the user enters his name and email it
needs to check a table to see if there are already any record and if so
load the dropdown to all the user to choose one.

Thanks,

Tom.

Nov 19 '05 #3

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

Similar topics

6
by: Alex Bink | last post by:
Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data. Only if he clicks on another specific control he is allowed...
2
by: Anand Sagar | last post by:
My program requirement is to create 2 textboxes at run time. When the cursor leaves the first textbox, (i guess the TextChange event) I want something to occur (post data into database) Problem...
6
by: Tim Westmoreland | last post by:
Can someone tell me how to raise an event or trap when the maxlength of a server side textbox has been reached?
4
by: liups | last post by:
Hi, I have an array of usercontrols, each of the usercontrol has a label and a textbox, I want to do some checking when the textbox loses focus, the code is like this: Private Sub...
3
by: William E Voorhees | last post by:
I have code (using the leave event) in a textbox which prevents the user from leaving the box if it is blank. I would like the user to be able to click on the button of the form and close that...
0
by: Silver Oak | last post by:
I have a DataGrid in which one of the columns is TemplateColumn that was created dynamically using iTemplate. I would like to have multi-row editing capability on the DataGrid. I'm trying to...
2
by: Sin Jeong-hun | last post by:
Suppose class Engine do something in another thread and raise events. class Engine { Thread Worker; public event ... EngineMessage; public void Start() { Worker=new Thread(new...
2
by: rajkm42 | last post by:
Hi friends, I have a gridview which loads an XML file to display a textbox and other dropdownlists. Which is used for data entry. The user will enter an empid in the textbox. Once leaving the...
6
by: sureshl | last post by:
In my calandar_selectionchanged event .. am showing a div region in my page on the top of the calendar . Like www.bytes.com on clicking Login You will find a small page opens similarly which i...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.