Jump to content

how to block Russian characters in pre-sales subject field


cdeese8

Recommended Posts

Might you know of any sneaky ways, or creative things I can do to stop this?

Can you please tell me how to prevent, block and disable any non-English letters? Specifically, I think it would be great to prevent letters from the Cyrillic script (Russian Alphabet). Literally, every spam ticket I get is from Mother Russia.

I know there is form captcha, but I don't want to use any services related to google or even the baked in WHMCS. The less steps a visitor has to do to get support the better.

Thanks for your time,

Link to comment
Share on other sites

20 minutes ago, bear said:

Perhaps make support tickets for logged in users only (since visitors need only pre-sales "support" I'd guess), and presales tickets use at least CAPTCHA (easily defeated, though).

Anything else come to mind? How do you block non-English letters from the pre-sales contact form that is shown to logged out users?

Yea I agree, CAPTCHA isn't very good and often worthless. The CloudFlare protected websites that display captcha for example are a pain in the butt and i almost always just close the website. Also, I've noticed if you are not using a Chrome browser, you will get SOOOO many more "captcha requests" just b/c you are not using the actual google browser. A joke ehh?

 

Link to comment
Share on other sites

48 minutes ago, cdeese8 said:

Anything else come to mind? How do you block non-English letters from the pre-sales contact form that is shown to logged out users?

i'd agree with @bear about making them login first - but if you're not going to do that, then you could edit the contact.tpl template and use a HTML5 pattern...

<input type="subject" name="subject" value="{$subject}" !class="form-control" id="inputSubject" pattern="[^аоуиеёэюяыбвгджзйклмнпрстфхцчшщ]+" oninvalid="this.setCustomValidity('Do not enter Russian characters')" oninput="setCustomValidity('')" />

5OHKPC6.png

although in order to make the pattern work, you need to disable the form-control class on the element... that disrupts the styling a bit, but you would just need to recreate the form-control class in a custom.css, call it something else and use that class in this element... the above is tested as working on v7.4.2 (which if you're still using v7.4.1 is the closest dev i've got to it)... JS/jQuery validation hooks could be an alternative too.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated