Hi there I'm having a little difficulty with controlling how a user enters a specific word into a field. As advised by Nathan, I would like to place a required field into my form code where the user has to enter the word "wind". (purely for spam purposes). So far, I have created the field but how do I control the text to be only "wind"? Here's my code as it stands. Currently any word can be typed into the field.

<input name="wind" type="text"

id="wind" size="18" value="" tabindex="8" title="wind"


  • can someone edit the tag on this question? Andy Ford almost 8 years ago

4 answers


It's the form processor that needs to check this field, not the form.

what's the form action? - where does it send the contents? that script is the one that needs editing to check that the field with id wind contains the text wind.

as an aside you probably should name the field something other than what you expect its content to be, a spam bot might just try that!

Answered almost 8 years ago by Tony Crockford

Hi Tony

Here are the form action details:

    <input type="hidden" name="recipient" value="info@tagdesign.co.nz">
    <input type=hidden name="subject" value="Registration Enquiry">
    <input type="hidden" name="redirect" value="http://www.harbourwind.co.nz/submit.html">

    <input type="hidden" name="required" value="hw-123,hw-124,secure-word">
    <input type="hidden" name="env_report" value="REMOTE_HOST, HTTP_USER_AGENT">
    <input type="hidden" name="print_config" value="email,subject">
    <input type="hidden" name="print_blank_fields" value="1">
    <input type="hidden" name="title" value="">
    <input type="hidden" name="return_link_url" value="">
    <input type="hidden" name="return_link_title" value="">

I don't have a specific action on the "wind" field. But what should happen is if the user types in (for arguement sake) the word "winde" and then selects the submit button, the error page should come up prompting that the word "wind" has not be typed in correctly and to go back to the form page and try again.

However, if the user does type the word "wind" in correctly, then when they select "submit", it goes to a thank you for your submmission page (currently doing this) and the form gets emailed to the client.

So, I am not really sure how to show the "wind" action in the form itself and I am not sure how to show this in the "formmail.pl" script if this is where the value is suppose be placed.

I was wondering whether anyone had an example of something similar where I could use that and customise to what our requirements are.

This is the website where the form resides: http://www.harbourwind.co.nz/register.html

Thanks very much

Answered almost 8 years ago by Felicia

it's formmail.pl that needs to check the content of that field and I'm not sure that formmail does that or can do that.

could you install a different form to email script?

I like: http://formtoemail.com/

Answered almost 8 years ago by Tony Crockford
  • PHP Forms - The best form creator & processor solution since 2003 http://phpforms.net Create any kind of web form in several mouse clicks! Generate a code that can be easily copied and pasted to any web page stoy_v over 7 years ago

OK thanks very much. I will give this a go.

Answered almost 8 years ago by Felicia