blocking a tld
is there a way with the form validation to not allow any email addresses ending in .ru
is there a way with the form validation to not allow any email addresses ending in .ru
Are you using client or server validation? I'm sure it can be done with a regular expression.
client side. I want the form to fail if the email address ends with .ru
I looked into this and it wasn't really easy to do. So I updated the jquery.h5validate.js file to make it possible.
Replace your version of the file with the one I have attached.
Then you can add a new attribute to your input field that you want to add the validation to like this:
<input type="email" validate="notspam"
And then add a function to defile what notspam means like:
<script>
function notspam(el,val) {
var notAllowed = /\.ru\s*$/i;
if (notAllowed.test(val)) return false;
return true;
}
</script>
thanks BUT this is weird. When I submit the form it WILL NOT send the email to the BCC (me) BUT it still goes straight through to the main site email.
I never used jquery validation so I am probably doing something wrong. Here is the link to my contact page.
https://jwdrivingssl.com/contact.php
Your jquery validate scripts have to be below your jquery includes... and you have to use a separate <script> tag for your inline script, you can't combine it with an external script file. So this code:
<script type="text/javascript" src="webassist/jq_validation/jquery.h5validate.js">
function notspam(el,val) {
var notAllowed = /\.ru\s*$/i;
if (notAllowed.test(val)) return false;
return true;
}
</script>
needs to look like:
<script type="text/javascript" src="webassist/jq_validation/jquery.h5validate.js"></script>
<script>
function notspam(el,val) {
var notAllowed = /\.ru\s*$/i;
if (notAllowed.test(val)) return false;
return true;
}
</script>
And all of that code needs to move down to below the jquery.js code reference.
still no go, must be me. See attached private msg
I can't debug it easily looking at the script. Do you have a URL? I see the old url you gave hasn't been updated.
https://jwdrivingssl.com/contact.php
is the current version. I just uploaded it
also the script DOES BLOCK the email to the bcc, but passes it to the main email
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.