Solved

Force onblur event

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

743 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

13 Experts available now in Live!

Get 1:1 Help Now