1 iceblock Mar 20, 2012 06:05
3 iceblock Mar 21, 2012 01:24
1) I can't figure out how to validate the new field. A 'subject' field was added to the form. What is the value to check? Any examples?
2) Thanks, set the antispam threshold to 99 and it works!
4 iceblock Mar 21, 2012 04:06
Sorry, I mistyped the function name. I can now do validation in CommentFormSent(). What is the best way to pass information to display the error message on the form?
5 sam2kb Mar 21, 2012 04:53
function DisplayCommentFormFieldset( & $params )
{
// display a text input field
$params['Form']->text_input( $this->get_class_id('myparam'), 'default value', 50, 'My param', 'Enter the value here' );
}
function CommentFormSent( & $params )
{
$myparam = param( $this->get_class_id('myparam'), 'string' );
if( empty($myparam) )
{ // The field is empty, let's display an error and reject the comment
$this->msg( 'You must enter the value', 'error' );
}
}
6 iceblock Mar 22, 2012 02:19
Thanks for the example.
CommentFormSent()
You need to configure Antispam setting for delete threshold in order to use karma. Make sure it's < 100, e.g. 99