467,132 Members | 1,167 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,132 developers. It's quick & easy.

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
  • viewed: 3881
Share:
2 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Tim Westmoreland | last post: by
4 posts views Thread by liups | last post: by
3 posts views Thread by William E Voorhees | last post: by
2 posts views Thread by Sin Jeong-hun | last post: by
2 posts views Thread by rajkm42@googlemail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.