Solved

Force onblur event

Posted on 2006-10-27
4
1,178 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now