aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes not rendering alert when focus is out of text box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "not rendering alert when focus is out of text box" Watch "not rendering alert when focus is out of text box" New topic
Author

not rendering alert when focus is out of text box

TahirAhmad Dar
Greenhorn

Joined: Oct 13, 2012
Posts: 12
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

Inspect line #6 carefully.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

More problems: Why are there script tags between the head and body? Why are including jQuery twice?
TahirAhmad Dar
Greenhorn

Joined: Oct 13, 2012
Posts: 12
// Thanks The following code works fine on eclipse


<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
<title>Focus Events</title>
<script type="text/javascript" language="javascript"
src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready ( function(){
//Focus the component when document is ready
$("input#inputBoxId").focus();
//Get focus when document is ready
$("input#inputBoxId").focusin(function (){
alert("This is focus in event.");
});
//Lost focus when document is ready
$("input#inputBoxId").focusout(function (){
alert("This is focus out event");
});
});
</script>
</head>
<body>
<h1>Focus events example</h1>
Input Box:
<input type="text" id="inputBoxId"></input>
</body>
</html>
TahirAhmad Dar
Greenhorn

Joined: Oct 13, 2012
Posts: 12
Thanks again for your help Bear Bibeault .
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

There are still lots of problems with that code. (And please UseCodeTags.)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: not rendering alert when focus is out of text box