Security for form maker using javascript

Kellie Knight created the topic: Security for form maker using javascript

Hi All, i'm a newbie and don't really understand javascript either!

My questions are:

1/ How do i add javascript so that form fields are not allowed to contain URL's in my forms?
2/ Is there any place i can find examples of javascript OR instructions on best practice security for form maker?

Thank you

Kellie

#89253

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


Anoush replied the topic: Security for form maker using javascript

Dear Kellie,

Thanks for getting to us and using our products!

OK, we can help you this way. If the system finds URLs in the form's fields then it will not allow submitting the form.

So please go to below 3 files > search function check_required and add the code we provided. I am showing here how you can add the code.

1. components/ com_formmaker / views / formmaker / tmpl / default.php
2. modules/ mod_formmaker / helper.php
3. plugins/ content / loadformmaker / loadformmaker.php

// Check URL in fields
var filter_rev =/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var check_form_text = jQuery('.wdform-element-section input[type="text"]').val();
var check_form_textarea = jQuery('.wdform-element-section textarea').val();
if (filter_rev.test(check_form_text)) {
alert("You can't use URL address");
jQuery('.wdform-element-section input[type="text"]').focus();
return;
}
if (filter_rev.test(check_form_textarea)) {
alert("You can't use URL address");
jQuery('.wdform-element-section textarea').focus();
return;
}


Thanks and have a great weekend :)

#89291
The following user(s) said Thank You: Kellie Knight

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


Time to create page: 0.129 seconds
Powered by Kunena Forum

WORLD-CLASS SUPPORT

We are here for you every step of the way. Turn to our support with any questions you might have about our products and services. Our experienced customer care team is available to help you as fast as we possibly can.

Contact us