Files
zulip/zephyr/static/js/signup.js
Keegan McAllister f2a73985c9 Fix my own variable typo (whoops)
(imported from commit d12467db2756281fe0710645825c54c269ab6781)
2012-10-03 17:39:14 -04:00

29 lines
845 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*jslint browser: true, devel: true, sloppy: true,
plusplus: true, nomen: true, regexp: true */
/*global $: false, jQuery: false */
var disallowed_domains = ['gmail.com'];
function validate_email_domain(value, element, param) {
var splitted = value.split("@");
var domain = splitted[splitted.length - 1];
return $.inArray(domain, disallowed_domains) !== -1;
}
$.validator.addMethod("fromDomain", validate_email_domain,
"Please use your company email address to sign up. Otherwise, we wont be able to connect you with your coworkers.");
$(function () {
$("#email_signup").validate({
rules: {
email: {
required: true,
email: true
}
},
errorLabelContainer: "#errors",
errorElement: "div",
errorClass: "alert"
});
});