Jump to content

Search the Community

Showing results for tags 'focus'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 6 results

  1. AARRGGHHH

    Does an HTML5 Control Have Focus?

    I'm having a problem determining if a given control has focus. It seems to me that: if (form.password.focus() == true) ... should tell me if the form's password control has focus. But, it's returning "false" even while I'm typing into the control. So, what is the correct way to determine whether a control has focus? Thank you!
  2. iwato

    Failure to Transfer Focus

    The PROBLEM: The problem can be observed on the internet at overview.html. After the page opens: Find the words Weekly Podcasts in the page's navigation bar and click on them. After the page opens find the Seven Gates subscription form. Find the select control called Select a Language and click on it. Scroll to the bottom of the list until you arrive at the Not found? option and click where it says Click and enter! If the focus transfers to the newly opened window, then you can see something that I cannot. This failure to transfer focus is the problem. QUESTION: Why does the following code fail to realize the aforesaid mentioned transfer of the focus from the window containing the phrase Click and enter! to the newly opened, blank window? In effect, users cannot enter a missing language without first placing the cursor into the newly opened window. They cannot simply being typing after they click on the words Click and enter!. Alas. HTML <div id='pc_language_options' style='clear:both;'> <label for='pc_tongue'>Native Tongue:<span class="formlabel">*</span></label> <span class="rightfloat"> <select id="pc_tongue" name="language" style="width:auto;"> <option selected value="0">Select Language</option> ... <optgroup label='oceania'> <option value=mi>Maori</option> <option value=haw>Hawaiian</option> <option value=sm>Samoan</option> </optgroup> <optgroup label='Not found?'> <option id="not_found" value='other_tongue'>Click and enter!</option> </optgroup> </select> </span> </div><!-- end div#pc_language_options --> <div id='pc_other' style='margin-top:0.8em;'> <span class="rightfloat"><input id='pc_other_input' type='text' name='other' value=''></span> </div><!-- end div#pc_other --> <label id="pc_tongue_error" class="error" for="pc_tongue">This field is required.</label> JAVASCRIPT $('#pc_other').hide(); $('#pc_tongue').change(function() { if ($('#pc_tongue').val() == 'other_tongue') { $('#pc_other').show().focus(); } else { $('#pc_other').hide().focusout(function(){ $("label#pc_tongue_error").hide(); }); } }); By the way, this is hardly where my experimentation stopped. I have tried many ways using different combinations of the show(), hide(), focus(), focusin(), blur(), and focusout() functions -- and these, both with and without callback functions. Unfortunately, to no avail. I have learned, in effect, many different ways to mess up what already works, but I simply cannot get it to work with the desire enhancement -- a transfer of focus. Roddy
  3. I know how to set focus on a specific input control, e.g. a text box, e.g.: <script type="text/javascript"> document.Login.brugernavn.focus(); </script> Now I have a web page with no input controls. The problem is that Page Down doesn't work until I click somewhere on the form to have it receive focus. I would like that to happen automatically when the page loads, but I haven't found a solution. The page contains two forms with tables inside. I have tried to use focus() on the form or on a (disabled) input control, but nothing works. Can anybody help me? Thanks in advance...
  4. naag

    Not able to focus

    Title<img src="images/smallindex.jpg" /></td><td><html:select property="title"><html:option value="">--SELECT--</html:option><html:option value="Mr."></html:option><html:option value="Mrs."></html:option></html:select></td><html:submit value="submit" styleClass="button" property="method" onclick="onSave()"/>function onSave(){if(document.forms[0].title.value==""){alert("Title should not be left blank");document.forms[0].getElementById('personalInformation').title.focus();//document.forms[0].title.focus();return false;}} i donno what wrong in this script, it not focusing on title if it is empty....can u please someone help me..thanks ...
  5. tinfanide

    Javascript: object.focused = true?

    if (object.focused = true) {// do something} Is there a way to check if an element is focused in JavaScript?
  6. Hello, I am trying to replace an emoticon for text into a textarea (Actually I may be interested in including the emoticon itself, but it seems to be more complex, and first I would like to learn how to do this.)I have the following in HTML: <a href="javascript:Smile(' [] ')"><img src="http://www.websmileys.com/sm/sad/239.gif" border="0" alt="imagen" /></a><br /><div style="text-align:center;margin-bottom:25px"><form name="formulariol"><textarea cols="40" name="textol"rows="4" id="txt" ></textarea></form> and the following, in Javascript, related to the former: <script type="text/javascript">function Smile(texto){document.formulariol.textol.value = document.formulariol.textol.value + texto;document.formulariol.textol.focus();}</script> It works fine, but either in Chrome or in Safari the cursor is set just before the text that replaces the emoticon, not after.I would like it to be at the end of the text, in all browsers.any idea about how to handle this, please? Thank you very much in advance. Regards
×