Forums

allow plain text only?

wdemilly 12 Sep, 2010
I want to use Chronoforms as a simple contact form, similar to the default demo form. However I do not want to allow anything but plain text to come through (I'm getting spam with HTML links etc).

Is there a way to do this through validation, and if so can someone point me to a script?

Thanks!
GreyHead 13 Sep, 2010
Hi wdemilly,

Try adding this code in the OnSubmit before box
<?php
$var_name = JRequest::getString('var_name', '', 'post');
JRequest::setVar('var_name', $var_name);
?>
where you replace var_name with the input name that you want to sanitise.

I also recall a thread where Fredrik ('nml375') posted on a server-side validation approach to blocking spam like this.

Bob
This topic is locked and no more replies can be posted.