Search Results

Search found 4289 results on 172 pages for 'focus stealing'.

Page 13/172 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • How to set the focus on the first <select> element of the page using JQuery?

    - by user605660
    Hi. I would like to set the focus on the first element of the page using JQuery when the page is loaded. I could successfully set the focus for first element by using $(":input:visible:first").focus(); or $(':input:enabled:visible:first').focus(); , according to jquery, set focus on the first enabled input or select or textarea on the page . I tried to use something like $('select:first').focus(); or $("select").first().focus(); or $(':visible:first').focus(); or $('enabled:visible:first').focus(); or other variations I could think of, but have not succeeded. Could anyone help me on this problem? I am a beginner for JQuery. I would like this function to work for all major browsers. Thank you very much!

    Read the article

  • ASP.NET required field validator firing on focus in Firefox

    - by ren33
    I have 2 asp.net textboxes in an update panel. Both textbox controls have some javascript attached to autotab to the next field and to allow only numeric input. When I enter some data into the first field and press enter, focus shifts to the next field and the requiredfieldvalidator of the second field displays its "* required" error message, even though I've just entered the field. This is only happening in Firefox. How can I prevent the validator from firing when I first enter the textbox? edit Here's the code: <asp:TextBox ID="add_ISBN" runat="server" Columns="14" MaxLength="17" CssClass="focus" /> <asp:TextBox ID="add_Qty" runat="server" Columns="4" MaxLength="4" /> <asp:RequiredFieldValidator ID="rfvQty" ControlToValidate="add_Qty" ErrorMessage="* required" ForeColor="Red" Display="Dynamic" EnableClientScript="true" ValidationGroup="Add" runat="server" /> In the codebehind: add_ISBN.Attributes.Add("onkeydown", "return isbnCheck(event, '" & add_Qty.ClientID & "')") And the javascript: function isbnCheck(e, id) { e = e || window.event; var key = e.which || e.keyCode if (validIsbnChars.indexOf(parseInt(key, 10)) >= 0) { return true; } else { if (key == 13) { var nextfield = document.getElementById(id); if (nextfield) nextfield.focus(); return false; } if (e.preventDefault) e.preventDefault(); e.returnValue = false; return false; } } The javascript allows only a valid subset of characters, and if the user presses enter, sets focus to the next field.

    Read the article

  • Dom Traversal to Automate Keyboard Focus - Spatial Navigation

    - by Steve
    I'm going to start with a little background that will hopefully help my question make more sense. I am developing an application for a television. The concept is simple and basically works by overlaying a browser over the video plane of the TV. Now being a TV, there is no mouse or additional pointing device. All interaction is done through a remote control. Therefore, the user needs to be able to visually tell which element they are currently focused upon. To indicate that an element is focused, I currently append a colored transparent image over the element to indicate focus. Now, when a user hits the arrow keys, I need to respond by focusing on the correct elements according to the key pressed. So, if the down arrow is pressed I need to focus on the next focusable element in the DOM tree (which may be a child or sibling), and if they hit the up arrow, I need to respond to the previous element. This would essentially simulate spatial navigation within a browser. I am currently setting an attribute (focusable=true) on any DOM elements that should be able to receive focus. What I would like to do is determine the previous or next focusable element (i.e. attribute focusable=true) and apply focus to the element. I was hoping to traverse the DOM tree to determine the next and previously focusable elements, but I am not sure how to perform this in JQuery, or in general. I was leaning towards trying to use the JQuery tree travesal methods like next(), prev(), etc. What approach would you take to solve this type of issue? Thanks

    Read the article

  • Always route a keypress to an application regardless of focus

    - by George Mauer
    I have to transcribe some audio (not enough to download dedicated software but enough to put my hacker hat on) and flipping back and forth between vlc and my text editor every time I want to pause is really annoying. Is there a way to always route a key-press (for example F10) to vlc regardless of what window has focus. Bonus - I have a Makey Makey so if I can get this working I can create a pedal and it will be my first real use of it!

    Read the article

  • jQuery - window focus, blur events not triggering - works in Firefox and Chrome

    - by brian newman
    In a nutshell; I wrote a simplistic chat application for a buddy and me to use. When the window running the application does not have the focus (minimized or behind other windows) and a message comes in, I want to change the windows title bar to serve as an alert. Exactly like Google's chat application does in GMail. Everything works flawlessly in Firefox and Chrome but not in IE7 (haven't tested 8). This is the code I am using to determine if the window has focus. Can this be written differently to also work in IE? Also, I'm open to any other approaches to accomplish the same thing. Many thanks in advance. $(window).bind("blur", function() { hasfocus = false; }); $(window).bind("focus", function() { hasfocus = true; });

    Read the article

  • WPF Datagrid -DataGridTemplateColumn tab focus issue

    I am using Microsoft WPF datagrid. I have noticed a strange behavior with WPF datagrid DataGridTemplateColumn. When you use the templateColumn in the grid and the template column contains some controls when you tab from the previous column the focus is not automatically given to the first element declared in the template column. The foucs is initally set on the border of the template column and when we tab of once agin the focus goes to the first column. Any workaround for this issue. How can i set the focus to go the first element in the template column of the datagrid when i tab off.

    Read the article

  • Set focus on textbox after postback.

    - by Niike2
    I have a search page with 3 TextBoxes that users can filter a search with. I have put the focus on the TextBox that contains text. If more than one contains text just focus on last TextBox. private void SetFocusOnTextBox(ControlCollection ctrlCollection) { foreach (Control ctrl in ctrlCollection) { if (ctrl.GetType() == typeof(TextBox)) { if (((TextBox)ctrl).Text != string.Empty) { SetFocus(ctrl); } } } } After the code runs and a user searches, the focus comes to the beginning of the TextBox, not the end where it would be presumed. How to put insert marked at the end of that TextBox?

    Read the article

  • Open a new browser window, or set focus to an existing browser

    - by Craig Myles
    Hi, I'm using code similar to the following: http://blog.flexexamples.com/2007/08/29/launching-new-browser-windows-from-flex/ I have a Flex app running in AIR, and when I click on a URL it opens a new tab in my existing browser. In addition to this the focus doesn't set to the browser. What this means is that I'm not aware of the URL opening in the browser unless I actually change focus from the app to the browser. Is it possible to open a brand new spanking browser, or change focus to the browser so its really obvious to the user? Thanks.

    Read the article

  • Issue with focus of a Silverlight Listbox

    - by Malcolm
    I have a button and on click of that i show a popup which has a listbox. popup named - popComboList Listbox named - lstComboBoxResult I am giving a focus to a listbox but at initial on a click of a button the listbox doesn't get focus-(this happens only once at initial, when i first time click button) After the second click it works. private void bnOpen_Click(object sender, RoutedEventArgs e) { if (IsDesignTime) return; lstComboBoxResult.Width = tbComboValue.ActualWidth + bnOpen.ActualWidth; if (!popComboList.IsOpen) { SetPopupPosition(popComboList); popComboList.IsOpen = true; lstComboBoxResult.Focus(); } else { popComboList.IsOpen = false; } }

    Read the article

  • Twitter's Bootstrap 2.x popover callback can't focus on element

    - by mozgras
    I've modified bootstrap's popover function to include a callback which works great. But in the callback I cannot programmatically focus on the first form field. Strange, because I can manipulate other elements in the callback function as well as focus on the element at other points. Here's the code to add a callback which I got from another SO question (http://stackoverflow.com/a/14727204/1596547): var tmp = $.fn.popover.Constructor.prototype.show; $.fn.popover.Constructor.prototype.show = function () { tmp.call(this); if (this.options.callback) { this.options.callback(); } } Here's the popover code: $('#a-editor-btn').popover({ html: true, placement: 'bottom', callback: function(){ $('#a-form-point').focus(); //nothing happens console.log('hello'); // works . . }, content: $('#a-form').html() }).parent().delegate('button#insert-point-btn', 'click', function() { insertPoint(); }).delegate('.a-form','keypress', function(e) { if ( e.which == 13 ) { insertPoint(); } });

    Read the article

  • Problem setting focus to validationsummary control after validation

    - by Ed
    Hi, I have a validationsummary control which displays the summary of a few validationrequired controls and all of them belong to a validationgroup. My submit button also has the same validationgroup so it validates everything upon it being clicked. The problem i am having is setting the focus to the validationsummary control after validation occurs when my submit button is clicked. The focus goes to the top of my webform. I need the focus to be put at the validationsummary control. How do i achieve this? FYI:SetFocusOnError="true" did not work. Thanks for reading.

    Read the article

  • Cannot set focus on input field in infoWindow

    - by thomas
    Hi Why is focus not set to noteTitle? I am using google maps API V3. The getNoteForm() returns a input field "noteTitle". The $("#noteTitle").focus() works fine when executed in firebug. I call this function when clicking on the map: function setNewNoteInfowindow(latlng) { if (geocoder) { geocoder.geocode({'latLng': latlng}, function(results, status) { var address = ""; if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { address = results[1].formatted_address; } } newNoteInfowindow = new google.maps.InfoWindow({ content: getNoteForm(latlng, address), size: new google.maps.Size(40,50) }); newNoteInfowindow.open(map, newNoteMarker); google.maps.event.addListener(newNoteInfowindow, 'domready', function() { $("#noteTitle").focus(); }); google.maps.event.addListener(newNoteInfowindow, 'closeclick', function() { newNoteMarker.setVisible(false); }); }); } }

    Read the article

  • Some little extra space is being added when a drop-down is on :focus

    - by catandmouse
    My problem is that when I place :focus style for our dropdown lists like so: input, select { margin: 0; padding: 0; } select:focus { background: #FFC; } ...the dropdown with the focused selection suddenly has an extra spacing on all sides (1-2px spacing). See images below: It may seem unnoticable on the photos above but when you do a selection, the increase in padding/spacing cannot be missed. I already tried removing margin: 0, padding: 0, thinking that the :focus state might be reverting to the padded version but still the same. Has anybody encountered this problem? Only happens in Firefox.

    Read the article

  • Flash Sprite looses focus on MOUSE_DOWN event

    - by John
    My Sprite class keeps losing focus when I click with the mouse - specifically after the MOUSE_DOWN event (before the click is complete). I have set mouseEnabled to false on the children, no change. I added a listener for FOCUS_OUT and noticed that the FocusEvent.relatedObject property is NULL, which is confusing me - doesn't that mean there is no new focus target, the focus is just getting lost? The exact sequence of events I get, by tracing them, as I click: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0] [MouseEvent type="mouseDown" bubbles=true cancelable=false eventPhase=2 localX=355 localY=362 stageX=360 stageY=367 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=true delta=0]) [MouseEvent type="click" bubbles=true cancelable=false eventPhase=2 localX=355 localY=362 stageX=360 stageY=367 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

    Read the article

  • CDateTimeCtrl - preventing 'focus' change when setting date

    - by WalderFrey
    I'd like to use a CDateTimeCtrl to allow the user to select a non-weekend date. So, if the user increments the day (via a keypress) - and the resulting day is found to fall on a weekend - then the control should skip forward to the following Monday (don't let issues about month changes distract you, it's not relevant). Usually it's not a problem: when I handle the DTN_DATETIMECHANGE notification I can check the new date/time and if it's found to be a weekend then I can call SetTime on the control to update the date. However, if I set the style to DTS_SHOWNONE, this call to SetTime causes the control to shift the input 'focus' (term used loosely) to the 'none' checkbox, e.g. away from the day field. This prevents the user from using keyboard input to continue incrementing the date unless they subsequently use the right arrow key to reset the 'focus', which is just nasty. I would dearly like to prevent this focus shift from occurring. Is it even possible?

    Read the article

  • jquery how to set input focus on control

    - by user516883
    Hey I am very new to jquery using asp.net, and I was wondering how to set focus on a textbox using jquery. I have my script in my HeaderContent but it is not working, no focus on load. And yes I know this can be done on the server side as well, but I am just trying to get better and more familiar with jquery. Thanks. <script type="text/javascript"> $(document).ready(function () { $("#MainContent_LoginUser_UserName").focus(); }); </script>

    Read the article

  • New Xming Windows Doesn't Grab Focus

    - by Isaac Rabinovitch
    I do my day-to-day work on Windows 7 (no, that's not going to change) and often need to work with Linux running on Parallels. Switching between Windows and Linux desktops is a pain, so I've installed Cygwin+Xming (less complicated than CygwinX). I open a Cygwin command line using mintty, then do ssh -Y to get a Linux command line. Doing "vim" on the Linux command line causes the vim window to appear on my Windows desktop. This is great, except that the new vim window doesn't automatically grab the focus, which stays with the mintty window. Years of habit cause me to start typing immediately without clicking on the new window. Having to switch manually is very jarring. Any way to make it automatic?

    Read the article

  • Firefox switches focus to previous window when the current newly opened window's page loads

    - by just asking
    The title pretty much sums it up. After opening the browser, when I open a new window (private browsing) and load the first page of interest, the focus goes back to the last Firefox window. It works with more than just 1 main and 1 private windows, like for example 3 main and 2 private windows. It repeats after closing all browser windows, waiting for it to unload and opening the browser again. I'm using Windows 7 and the latest version of Firefox, and it's been happening to me for about half a year on two different computers and a notebook (same OS and browser version). It's pretty annoying. How do I fix this?

    Read the article

  • Autosaving on emacs or xemacs files (preferably on loss of focus)

    - by Spencer
    Ideally I want to replicate with emacs functionality from TextMate, whereby on loss of focus i.e. I click away from the buffer, my file saves. If this isn't possible, I want to customize emacs so that it will autosave the file for every character I write. When I say this I don't mean I want to autosave to the ~ backup files. I want to save the file I am currently working on. I am working on a Fedora VM. Note I am not looking for a backup or autosave. I want the file I am actually in to save, so that if I loaded the html file I am editing in a web browser it would reflect my new changes without me having to explicitly change it.

    Read the article

  • Cursor and selection invisible if focus is lost

    - by Alois Mahdal
    "Latest" versions of Excel (I think it's since 2007) have a new added "feature" that if Excel windows loses focus, the cursor becomes invisible. Also coloring of headers is default, so it's impossible to locate cursor and/or selection as soon as I switch to other window. This annoys the hell out of me as it makes Excel almost unusable for most of tasks I need it for: keeping track of test cases while performing testing in another window. obtaining data somewhere else and porting it to Excel (I have never seen such behavior in other applications and can't even think of a justification for it.) Is is possible to turn this behavior off?

    Read the article

  • How to keep the highlight border of a JComponent, when custom border is set

    - by Frederik Wordenskjold
    I have a JTextField, where I've set some custom properties: nameField.setPreferredSize(new Dimension(275,40)); nameField.setBackground(bgColor); nameField.setForeground(txtColor); nameField.setFont(new Font("HelveticaNeue",Font.PLAIN,22)); nameField.setBorder(BorderFactory.createLineBorder(Color.WHITE, 2)); When the component has focus, there is no highlight shown around the field. On a Mac, it is usually a blue glowing rectangle, indicating that this component has focus. If I comment out the nameField.setBorder(...), the highlight reappears. How do I keep the highlight, but also my custom border!? Basically, I just want the highlight-border to show when the component has focus, and no border when the component is unfocused.

    Read the article

  • Setfocus to textbox from JavaScript after just creating the textbox with JavaScript?

    - by Scott
    So I just created a textbox with JavaScript like this: EDIT: Added the len variable var len = tbl.rows.length; var rtb = tbl.insertRow(len); var cName = rtb.insertCell(0); var cDis = rtb.insertCell(1); var cDur = rtb.insertCell(2); cName.innerHTML = '<input type="text" name="tbName1' + len + '" value="' + selected_text + '" >'; cDis.innerHTML = '<input type="text" name="tbDis1' + len + '" id="tbDis1' + len + '" >'; cDur.innerHTML = '<input type="text" name="tbDur1' + len + '" >'; var txtBox = document.getElementById('tbDist1' + len); txtBox.focus(); EDIT:Changed the second to last line. Still get this error: txtBox is null txtBox.focus(); The last line isn't working. After I create the textbox, I can't set focus to it. Is there any way of doing so?

    Read the article

  • Why won't my control accept keyboard input?

    - by Mason Wheeler
    I've built a custom control that I'm trying to send input to. It will accept mouse input and report MouseDown, MouseMove and MouseUp correctly, but for whatever reason, it won't accept keyboard input. When I click on it, it doesn't receive focus, and any keys I press get interpreted by whatever control had the focus already. This is probably something really simple. The first place I thought to look was in the ControlStyle property, but the only thing I can see in the helpfile about keyboard input is csNoStdEvents, which disables it, and my control doesn't have that. So what do I need to do to make it so my control can receive input focus?

    Read the article

  • Is MDI Form focused?

    - by Vercas
    I've had so much luck developing my application... until now. My application's main form is a MDI parent, and I didn't think of adding any MDI children in my tests until tonight. To my surprise, the MDI parent seems to never "get focus" now. The Focus event and the OnFocus method are never called! I mean... it appears focused but none of the in-code focusing events/methods work. Instead a MDI child reports the focus. How do I fix this?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >