Is there any way I can focus on text box?
i.e. Username on scenario below when username label is clicked?
<tr>
<td valign="middle" class="loginText">
<b>
<label for="UserName">
UserName:</label></b>
</td>
<td valign="middle" >
<input type="tel" maxlength="6" value="" name="UserName" id="UserName" data-val-required="The User name field is required."
data-val="true" /><br />
@Html.ValidationMessageFor(m => m.UserName)
</td>
</tr>
It works on Mozilla and IE but doesn't work on iPad Safari. Basically, I would like to iPad keyboard to popup when users click on label i.e. username in this scenario:
Here's my jQuery:
$("label[for]").click(function () {
var inputid = '#' + $(this).attr('for');
alert(inputid);
$(inputid).focus();
});