Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,392 Programmers. There are 1,407 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

hrm, checking for if focus has left a textbox

 
Reply to this topicStart new topic

hrm, checking for if focus has left a textbox, no code please just suggestions

rgfirefly24
post 5 May, 2008 - 09:29 AM
Post #1


D.I.C Head

Group Icon
Joined: 7 Apr, 2008
Posts: 135



ok, So here is the deal. I've been researching this for going on 5 days now and my boss is getting a little ansy as well as the client. I dont know diddly about Javascript, but need to find a way to check if a textbox lost focus so that i can fire a C# function.

now to itterate i am not looking for code what so over. Just a suggestion on material to read/or command to research.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Martyr2
post 5 May, 2008 - 10:17 AM
Post #2


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 3,561

Look up the javascript event onBlur. This event fires when focus leaves a control. That would be a nice place to start. smile.gif

This post has been edited by Martyr2: 5 May, 2008 - 10:17 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

rgfirefly24
post 5 May, 2008 - 10:35 AM
Post #3


D.I.C Head

Group Icon
Joined: 7 Apr, 2008
Posts: 135

QUOTE(Martyr2 @ 5 May, 2008 - 10:17 AM) *

Look up the javascript event onBlur. This event fires when focus leaves a control. That would be a nice place to start. smile.gif


cool, thanks. I've read up on onBlur and saw that i can dynamically add it to the txtbox control using
txtPhone.Attributes.Add("onBlur", "BuildSession();return false;");

but during runtime it just freaks out on me and freezes up debugging. (btw BuildSession() is a C# function not a JS function)

it tells me onBlurr is not a valid textbox control

This post has been edited by rgfirefly24: 5 May, 2008 - 10:38 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

PsychoCoder
post 5 May, 2008 - 10:39 AM
Post #4


ToCode || !ToCode

Group Icon
Joined: 26 Jul, 2007
Posts: 5,858

use onblur
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

rgfirefly24
post 5 May, 2008 - 10:40 AM
Post #5


D.I.C Head

Group Icon
Joined: 7 Apr, 2008
Posts: 135

QUOTE(PsychoCoder @ 5 May, 2008 - 10:39 AM) *

use onblur


wont accept onblur either...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

chrisman
post 5 May, 2008 - 03:53 PM
Post #6


New D.I.C Head

Group Icon
Joined: 22 Mar, 2008
Posts: 25

I don't know a lot about C# (okay...I know nothing. Dx) but "onBlur" is something you set to the input tag (or what have you). ex:

CODE

<input type="text" name="field1" onblur="myFunction()" />
<!-- Then, set "myFunction()" to contain what you want C# to do. -->


Hope that helps.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 05:05AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month