javascript - focus isnt working for text field -
source ->
<input name="ctl00$maincontent$mapusercontrol$6551_edit_artintheparkssculpturelocations_32_id" type="text" maxlength="50" id="ctl00_maincontent_mapusercontrol_6551_edit_artintheparkssculpturelocations_32_id" onchange="maxlength(50, this, 'id')" class="control-label form-control" id2="6551_edit_artintheparkssculpturelocations_32_id">
i can update text in field
x = document.getelementbyid('ctl00_maincontent_mapusercontrol_6551_edit_artintheparkssculpturelocations_32_id') x.value ="bla";
however can't update focus...
x.focus();
returns undefined expected nothing happens text field. have tried autofocus, , grabbin element jquery instead of js.... still no joy...any idea why?
have faced similar issue. calling focus through settimeout need.
settimeout(function() { x.focus()}, 1);
Comments
Post a Comment