troubleshooting Question

onBlur Set Focus.

Avatar of prasannap
prasannap asked on
JavaScript
12 Comments1 Solution6979 ViewsLast Modified:
Hi,

My problem is in netscape onBlur event, I can't set the focus back to the same control again.
How could I do it?

e.g.
<html><head><title>onFocus/onBlur/onClick Demo</title></head>
<body>
<form name="bla">
     <script language="Javascript">
      function bla_OnBlur()
      {
      document.forms["bla"].elements["blatext1"].focus();
       }
      </script>
<table border="1">
<tbody><tr><th>Box 1</th><th>Box 2</th><th>Button</th></tr>
<tr><td>
<input name="blatext1" type="text" onBlur="javascript:bla_OnBlur()" onfocus="document.getElementById('Info1').innerHTML = 'focus!'">
</td><td>
  <input name="blatext2" type="text" onfocus="document.getElementById('Info2').innerHTML = '...Focus...'" onblur="document.getElementById('Info2').innerHTML = '...Blur...'">
</td><td>
  <input name="blabut" type="button" value="Press me" onclick="window.close()">
</td></tr>
<tr><td id="Info1">focus!</td><td id="Info2">...Blur...</td><td></td></tr>
</tbody></table>
</form>
</body></html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros