Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. function LoginButonOnclick() {
  2. var data= {
  3. UserName: $('#UserNameTextBox').val(),
  4. Password: $('#PasswordTextBox').val(),
  5. };
  6. if (data.UserName== null) {
  7. $("#showwarning1").html('<img src="~/Image/warning.png">');
  8. }
  9. if (data.Password== null) {
  10. $("#showwarning2").html('<img src="~/Image/warning.png" />');
  11. }
  12. }
  13.  
  14. <input type="text" id="UsernameTextBox" name="UsernameTextBox"/>
  15. <input type="text" id="PasswordTextBox" name="PasswordTextBox"/>
  16. <input type="button" onclick="LoginButonOnclick()" value="Enter"/>
  17.  
  18. <div id="showwarning1"></div>
  19. <div id="showwarning2"></div>
  20.  
  21. <img src="~/Image/warning.png" title="Password is empty!!"/>
  22.  
  23. function LoginButonOnclick() {
  24. var data= {
  25. UserName: $('#UserNameTextBox').val(),
  26. Password: $('#PasswordTextBox').val(),
  27. };
  28. if (data.UserName== null) {
  29. $("#showwarning1").html('<img src="~/Image/warning.png">');
  30. }
  31. if (data.Password== null) {
  32. $("#showwarning2").html('<img src="~/Image/warning.png" />');
  33. }
  34. }
  35. <input type="text" id="UsernameTextBox" name="UsernameTextBox"/>
  36. <input type="text" id="PasswordTextBox" name="PasswordTextBox"/>
  37. <input type="button" onclick="LoginButonOnclick()" onmouseover="LoginButonOnclick()" value="Enter"/>
  38.  
  39. <div id="showwarning1"></div>
  40. <div id="showwarning2"></div>
  41.  
  42. $(function(){
  43. $("#showwarning1").on('mouseover', function(){
  44. //show error message to the user
  45. console.log("UserName Can Not Be Empty!");
  46.  
  47. });
  48.  
  49. $("#showwarning2").on('mouseover', function(){
  50. //show error message to the user
  51. console.log("Password Can Not Be Empty!");
  52. });
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement