how to set cursor to input box in javascript? -
document.getelementbyid(frmobj.id).value=""; document.getelementbyid(frmobj.id).autofocus; document.getelementbyid("errormsg").innerhtml = "only numeric value allowed"; in above code value of form object setting "" there no cursor in text box. want cursor there. focus() focuses input box not set cursor.
in javascript first focus on control , select control display cursor on texbox...
document.getelementbyid(frmobj.id).focus(); document.getelementbyid(frmobj.id).select(); or using jquery
$("#textboxid").focus();
Comments
Post a Comment