Questions tagged [focusout]

108 questions
78
votes
1 answer

blur event.relatedTarget returns null

I have an field and I need to clear it when this field loses focus (whiech means that user clicked somewhere on the page). But there is one exception. Input text field should't be cleared when user clicks on a specific element. I…
CMTV
  • 2,531
  • 2
  • 17
  • 25
15
votes
4 answers

JavaScript FocusOut - get the element that receives focus

When the FocusOut event is raised, how do you know which element receives the focus? The correct way seems to be to use the event's relatedTarget property. However, this seems not to work in all browsers: in Google Chrome, it works in Firefox and…
Peter M.
  • 1,240
  • 2
  • 9
  • 25
11
votes
3 answers

jquery need alternative to focusout()

Given the sample markup:
How can one, via jQuery, determine that div has lost focus? I can use focusout() but that's not quite what I need. With focusout, it will get triggered as one tabs from…
DA.
  • 39,848
  • 49
  • 150
  • 213
7
votes
4 answers

focusout on an element conflicting with click on other in Angular

I have focusout() event on element1 and click() event on element2, and when element1 goes out of focus because was performed a click event on element2, only focusout is fired, click event is not. This works fine [on jQuery][1] but not in Angular. I…
Addy
  • 147
  • 1
  • 1
  • 7
7
votes
2 answers

How to Trigger a Focusout Event Programmatically

How can I trigger a focusout event programmatically using just JavaScript not jQuery? For example, in the following code, the idea is that it should alert "Hello, world!" because of the focusout() function (or a similar event-causing function) being…
GTS Joe
  • 3,612
  • 12
  • 52
  • 94
6
votes
2 answers

tinyMCE textarea focusout event?

I am working on existing project. I have to detect tinyMCE focusout/blur event to save it automatically via AJAX. I found following existing working code: // reinit tinymce $($("#chapterBill…
Awan
  • 18,096
  • 36
  • 89
  • 131
6
votes
2 answers

DOM problem with click initiating a focusout event on a different input

I have an with focusout event handler I have a
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
6
votes
2 answers

focus() doesn't take cursor into field

I'm trying to force the cursor to go back to its previous input when the value is wrong. Here is a simpler version of the script I use : $('input:first-child').blur(function(e){ console.log('here'); $('input:first-child').focus(); }); It…
leyou
  • 806
  • 1
  • 13
  • 25
5
votes
3 answers

jQuery - Focus out on TR

Okay, so I'm making a plugin to allow inline editing of tables in my website, going great so far, I've got most of it done, but I can't seem to get Focusing out of the table right. So if someone is done editing and starts editing a new row or just…
Gareth Parker
  • 5,012
  • 2
  • 18
  • 42
5
votes
3 answers

Hide ul when lost focus in JQuery

I am trying to hide the sub menu items(ul) when it lost focus.. my structure looks something like this
5
votes
3 answers

How do you trigger a blur/focusout event on an input text box using jquery?

I'm using 1.7.2 in which I understand this should work: // cell is a jquery representation of a element cell.append($("", { "type": "text" }).val(content)); cell.children()[0].focus(); cell.children()[0].on("blur", function() { …
rich
  • 18,987
  • 11
  • 75
  • 101
4
votes
1 answer

Infinite loop in focusout jquery, only in Chrome

I have two input, one static: and other dynamic: $("", { type: "number", min: "0" }).addClass("someclass").appendTo($("#someid")); and this code works fine in static input: …
user7420251
  • 41
  • 1
  • 4
4
votes
1 answer

How can I make sure the content of a tkinter entry is saved on FocusOut?

I have an app that uses binding to automatically save the edits in an Entry to a list. There is no problem saving the Entry text when using TAB to navigate through the Entries or when I click on another Entry, but If I change the text on…
Alexandru Antochi
  • 1,295
  • 3
  • 18
  • 42
4
votes
2 answers

Mouseleave event not firing consistently in Firefox after focusout event

I am running the following code: