Is it possible to change a button from disabled to enabled once the value in the input field is correct
I have this form
@using (Html.BeginForm())
{
<input id="Email" name="Email" type="text" value="Email" class="form-text" />
<input id="bt_login_signup" type="submit" value="Sign in" class="bt_login"/>
}
I want the submit button to be enabled only once the email entered is correct. Is it possible to use watermark to do it ?
Thanks
I’m not sure ASP.NET MVC supports this out of the box, although you could certainly write some Javascript to do it (disable to begin with, check the text after each keyup event on the text box).
But why don’t you use the normal MVC Model validation? If the user submits invalid info, the error messages you configure appear next to each field …