The function below checks whether the entered ID is already in the database, and if it is, then it Adds some html table. I'm not sure whether this is directly related to my issue, but essentially, the user will focus on an id input field and will enter the ID. Using AJAX, it posts on a php script and gets rows, returns data and it is not so. If the user then clicks on the next input field (zipcode) in the tabs or other input fields, then they must do this twice as essentially in the cursor area, "flush" briefly and then focus. I tried to add in focus (), but the behavior did not change.
So, the HTML looks like this:
& lt; Table id = "tableSearchData" class = "search list" style = "width: 78 9px;" & Gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Id & lt; / Th & gt; & Lt; Th & gt; ZIP code & lt; / Th & gt; & Lt; Th & gt; Radius (in miles) & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt; Tr square = "weird" & gt; & Lt ;! - The problem is described below - & gt; & Lt ;! - The user has & lt; Input name = "id []" & gt; And ID is checked - & gt; & Lt !! - User press "tab" or & lt; In the input name = "zipcode [] (in the same * line) and cursor flash goes out of focus, so that the user has to click the field again - gt; & lt; td square =" center Classification1 "> input directly related to this problem, but I think it should be included as I think it seems that something like this is happening ... $ ("#TouchSetta> gtc; tbody> tr> td> Input [name = id []]"). Focus Out (function () {var row = $ (this) .closest ( "Tr") .Get (0); var sData = $ (this) .serialize (); $ .ajax ({type: "POST", url: "checkid.php", data: esdata, success: function (html ) {$ (Line) .replaceWith (html); $ (". Preset"). Each (function () {$ (this) .attr ("disabled", true);}); $ (Line) .closest ("input [name = zipcode []]"). Focus ();}}); });
Try:
$ (line) . Seems ("input [name = zipcode []]") focus () .;
Description : First get ancestor element starting with the current element and DOM matches the selector moving through the tree.
I believe that is not an ancestor of [name = zipcode []]
line
...
Comments
Post a Comment