TOPIC:

how to create a validation rule that rejects certain words in messages ? 4 weeks 1 day ago #248540

  • Topic Author
  • alpheratz
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
Hello
I have some trouble in my site with spammers that are capable to override captcha test and fill my mail with junk.

I would like to reject messages body that includes URL and/or e-mail addresses, simply by checking for presence of "http" sequence or "@".
Any idea to write a custom brewed validation script ?

cheers up !

Please Log in or Create an account to join the conversation.

how to create a validation rule that rejects certain words in messages ? 4 weeks 1 day ago #248542

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1664
  • Karma: 3
  • Thanks: 149
Hi,

go to your element->Validation ->check custom->Create code framework and put this:
function ff_NAMEOFELEMENT_validation(element, message)
{
   
     var ex = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/|www\.)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
    if (!ex.test(element.value) ) return '';
        if (message=='') message = element.name+" faild in my test.\n";
        ff_validationFocus(element.name);
        return message;
} // ff_NAMEOFELEMENT_validation

Please replace NAMEOFELEMENT with name of your element (not title).
With this code you can ban url

Let me know if it works for you

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.045 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!