Hi
I have below code . When alert is uncommented the focus is on first column otherwise no.
<script type="text/javascript"> window.onload = function () { /*alert("hi");*/ var empCodeField = document.getElementById("<%= txtEmployeeCode.ClientID %>"); empCodeField.focus(); }; </script> *********************** <div class="col-lg-3 col-md-6 col-sm-12"> <div class="form-group"> <label>Code</label> <span style="color: red">*</span> <asp:TextBox ID="txtEmployeeCode" TabIndex="1" MinLength="2" MaxLength="10" class="form-control alpha" placeholder="Employee Code" required="true" runat="server"></asp:TextBox> </div> </div>
Thanks