Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery focus function strange behaviour after fadeout
    primarykey
    data
    text
    <p>I have html code with multiple form with unique id. These form contains one input field and a anchor tag. Jquery Click event is associated with anchor tag which fadeout the parent tag ie form</p> <p><strong>prob 1.</strong> The problem in this is. If there is a space(where caret symbol directing) it is working fine other wise it wont. I don't know whether it is a jquery bug.</p> <pre><code>$("form[class='multiwords'] :input:visible:enabled:first").focus(); //-------------------------^-------------------------------// </code></pre> <p><strong>prob 2.</strong> When First form is removed focus is not setting to next textfield ie having value <em>Two</em></p> <p><strong>Just an Issue.</strong> After successful focus cursor is set to beginning of textfield in opera,IE but set to end at mozilla. Is it a browser issue?</p> <p>whole code</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;test&lt;/title&gt; &lt;script type='text/javascript' src='js/jquery-1.4.2.js'&gt;&lt;/script&gt; &lt;script&gt; $(window).load(function() { jQuery(document).ready(function() { jQuery('.perform').live('click', function(event) { var parentTag = "#"+$(this).parent("form").attr("id"); $(parentTag).fadeOut(); $("form[class='multiwords'] :input:visible:enabled:first").focus(); }); }); }); &lt;/script&gt; &lt;style type="text/css"&gt; .perform{ cursor: pointer; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="content"&gt; &lt;form id="f1" class='multiwords' name='f1'&gt; &lt;input type=text class="input multi" id='i1' name=da value='one'&gt;&lt;a hred=# class='perform' id='a1'&gt;Rem Form One&lt;/a&gt; &lt;/form&gt; &lt;form id="f2" class='multiwords' name='f2'&gt; &lt;input type=text class="input multi" id='i2' name=da value='two'&gt;&lt;a hred=# class='perform' id='a2'&gt;Rem Form Two&lt;/a&gt; &lt;/form&gt; &lt;form id="f3" class='multiwords' name='f3'&gt; &lt;input type=text class="input multi" id='i3' name=da value='two'&gt;&lt;a hred=# class='perform' id='a3'&gt;Rem Form Three&lt;/a&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload