Forum

Thread tagged as: Question, Problem, Forms

Spam Protection on Forms

I have the Akismet API key set in my Form settings: https://thesite.com/cms/addons/apps/perch_forms/settings

But spam that looks pretty obvious is coming through. Any idea on how to test it? Or confirm Akismet is working through the form?

Should I be adding the "antispam" tag to form inputs, or is that just for comments (which I don't need since I don't have site commenting)?

That said, is this correct?

<perch:label for="name"><i class="fa fa-fw fa-drivers-license-o"></i> Name</perch:label>
                                            <perch:input type="text" id="name" class="form-control" antispam="name" required="true" label="Name" />
Leigh C

Leigh C 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you need to have the antispam attributes set, or nothing will be sent to Akismet.

Once you have that, you'll be able to see from your Akismet account what's being stopped.

Leigh C

Leigh C 0 points

Great thanks! That will be very useful. Is my syntax correct in the line above?

antispam="name"

"name" being the ID of the input tag, correct? Hard to test it really, so I want to make sure I have the syntax right.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that looks correct according to the docs.

https://docs.grabaperch.com/addons/blog/spam/

Leigh C

Leigh C 0 points

Ok. Though the docs say:

<perch:input type="url" id="website" antispam="url" />

The antispam="url" is using the type, not the ID. Hence my confusion. So is the ID still right? Or is it by type?

Drew McLellan

Drew McLellan 2638 points
Perch Support

There are four possible values. name, url, email and body.

Leigh C

Leigh C 0 points

Ah, I see. So for future reference, here are the options for using the "antispam" tag in an input:

<perch:input type="name" id="" antispam="name" />
<perch:input type="url" id="" antispam="url" />
<perch:input type="email" id="" antispam="email" />
<perch:input type="body" id="" antispam="body" />
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't believe type="body" is valid. There's no relationship between the field type and the antispam value.

Leigh C

Leigh C 0 points

Ok. So then what do you use antispam="body" for? I would guess it's for "text" and "textarea" types, correct?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's for the main text of whatever you're evaluating as spam.

Leigh C

Leigh C 0 points

Ok thanks Drew!