2
I have the table AspNetUser
in my database that I use to identify and authorize logins.
To login to my page, the user always needs to type the [email protected].
It is possible to program the TextBox
to automatically fill the "@email with." ?
So the user would only need to fill in the Textbox: "user".
I want to follow the same idea of the Google site, where we do not need to fill the @gmail.with, just enter the first part of the email.
I’ve tried that:
<script>
function autoCompletEmail() {
var x = document.getElementById("email");
x.value = x.value + "wstur.com";
}
<div class="form-group">
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
<div class="col-md-10" id="email" onblur="autoCompletEmail">
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
@Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
</div>
</div>
Use the onleave textbox event to complete with @provider.com
– Vinicius
Thank you. Can you give an example of how you use it? I’m new to this area of ASP NET MVC.
– DP WS Receptivo