Guest User

Untitled

a guest
Feb 4th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <form>
  2. <div class="container">
  3. <div class="row">
  4. <div class="col-md-offset-2 col-md-4">
  5. <div class="form-group">
  6. <input type="text" class="form-control small" asp-for="UserName" />
  7. </div>
  8. <div class="form-group">
  9. <input type="text" class="form-control small" asp-for="Password" />
  10. </div>
  11. <div class="form-group">
  12. <a class="btn btn-sm btn-success pull-right" asp-action="Validate" asp-controller="LogIn" onclick="ValidateLogin()">Log In</a>
  13. <input type="submit" value="LogIn" asp-action="Validate" asp-controller="LogIn" onclick="ValidateLogin(this)" />
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18.  
  19. function ValidateLogin(e:Event) {
  20. var username = (document.getElementById('UserName') as HTMLInputElement).value;
  21. var password = (document.getElementById('UserName') as HTMLInputElement).value;
  22. if ((username.length > 0) && (password.length > 0)) {
  23.  
  24. }
  25. else {
  26. alert('Fields required');
  27. e.preventDefault();
  28. }
  29. }
Add Comment
Please, Sign In to add comment