forum

Home / DeveloperSection / Forums / HOW TO ADD FOCUS TO A FIELD WHEN THE USER LEAVES THE FIELD BLANK IN MY FORM?

HOW TO ADD FOCUS TO A FIELD WHEN THE USER LEAVES THE FIELD BLANK IN MY FORM?

Anonymous User 1984 26-Dec-2017

Hi,

I want to integrate autofocus into my application when the user leaves the field blank

Below is my code,

<div class="form-group">

                <label for="Username">Email or Username</label>
                @Html.TextBoxFor(x => x.EmailID, new { @maxlength = 100, @class = "qa-form-tall-text", placeholder = "User Name" })
                @Html.ValidationMessageFor(x => x.EmailID)
            </div>
            <div class="form-group">
                <label for="Username">Password</label>
                @Html.PasswordFor(x => x.Password, new { @maxlength = 200, @class = "qa-form-tall-text", placeholder = "Password" })
                @Html.ValidationMessageFor(x => x.Password)<br />
            </div>. 

Please provide some appropriate solution to accomplish my task.


Updated on 26-Dec-2017
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By