Solved

Force onblur event

Posted on 2006-10-27
4
1,181 Views
Last Modified: 2006-11-28
I have a window and an iframe. In the iframe there are text fields that update using the onblur event. If I click anywhere in either of the windows everything works as it should but if I click a nav button, the script doesn't have time to run. I have considered putting a timer on the nav buttons but that would add an unnessary delay to normal use. My other thought is to force the onblur event somehow when the mouse is exiting the iframe or moving over a div.

Any ideas would be greatly appreciated. Thanks!
0
Comment
Question by:dBedient
4 Comments
 
LVL 10

Accepted Solution

by:
gangwisch earned 125 total points
ID: 17820672
i have had the same problem before and what i do is just change the text of the button or change the image to say 'Loading..." also you can change the cursor to an hour glass so the user understands. Another idea would be to have an onclick event on your nav button and after everything is done updaating window.location.href over to where you need to be

Good Luck.
0
 
LVL 23

Assisted Solution

by:rama_krishna580
rama_krishna580 earned 125 total points
ID: 17822309
Hi,

try this..
<html>
<head>
<title>demo</title>
<script type="text/javascript">
var globalTakeFocus=null;

function setFocus(ref) {
globalTakeFocus=ref;
setTimeout("globalTakeFocus.focus();globalTakeFocus.select()",100);
}

function validateField(ref) {
if (ref.value != "ok") {
alert("Value must be \"ok\"");
setFocus(ref);
}
}
</script>
</head>
<body>
<form>
<input onchange="validateField(this)"><br>
<input onchange="validateField(this)"><br>
<input onchange="validateField(this)">
</form>
</body>
</html>

R.K
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question