?
Solved

Force onblur event

Posted on 2006-10-27
4
Medium Priority
?
1,195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 10

Accepted Solution

by:
gangwisch earned 500 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 500 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

777 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