We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5253
    • 17 Posts
    cheers everyone,

    i'm looking for a good solution (!= hacking the quip core) to validate email adresses. Actually I can enter whatever I want in die email field - it only validates empty or not. I think it should be possible to check an email adress at least for a dot and a @.

    Is there actually a way to do this without hacking the quip core?

    thanks in advance!
    Chris
      *there are no strangers - just friends who never met*
      • 43090
      • 3 Posts
      I'm using this:
      <script type="text/javascript">
      var IsEmail=function () {
      	var email=$('#quip-comment-email-qcom').val();
      	var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
      	if (regex.test(email)==false) {
      		$('button[name="quip-post"]').attr("disabled","yes");
      	} else {
      		$('button[name="quip-post"]').removeAttr("disabled");
      	}
      }
      $('#quip-comment-email-qcom').bind('keydown keypress', function () { setTimeout(function() { IsEmail(); }); });
      </script>

      Remember to include jQuery.