Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. function newsValidation() {
  2.  
  3. var status = true;
  4. if (($.trim($('#txtNewsname').val()) == '') || ($.trim($('#txtnewsarea').val()) == '') ||
  5. ($.trim($('#txtemail').val()) == '')) {
  6.  
  7. $("#reqfield").removeClass("hidden");
  8.  
  9. if (!ValidateEmail($("#txtemail").val())) {
  10. $("#emailval").removeClass("hidden");
  11. }
  12. status = false;
  13. }
  14.  
  15. function ValidateEmail(email) {
  16. var expr = /^([w-.]+)@@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$/;
  17. return expr.test(email);
  18. }
  19.  
  20. function newsValidation() {
  21. var status = true;
  22. if (($.trim($('#txtNewsname').val()) == '') || ($.trim($('#txtnewsarea').val()) == '') || ($.trim($('#txtemail').val()) == '')) {
  23. $("#reqfield").removeClass("hidden");
  24. status = false;
  25. } else if (!ValidateEmail($("#txtemail").val())) {
  26. $("#emailval").removeClass("hidden");
  27. status = false;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement