Welcome to WebmasterWorld Guest from 54.166.123.247

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Required fields Form2Email

     
7:19 am on Apr 11, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 20, 2008
posts: 133
votes: 0


Hi all,

Just wondered if anyone could tell me how to get the email and telephone number fields checked for valid data on a form being proccesed by Form2Email CGI script done.

Cheers
geoffb

4:16 pm on Apr 11, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Most of us here are coders/programmers and are rarely familiar with off-the-shelf free scripts. Did you try what is listed in their scant documentation [form2email.net]? (Scroll down from there to "Using the form for required fields")

Set the field names in your form that require data. The script can check for any data, just numbers or just an email address.

<input type="hidden" name="required_fields" value="field,name">
<input type="hidden" name="required_fields_numbers" value="field,name">
<input type="hidden" name="required_fields_email" value="field,name">

8:28 pm on Apr 11, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 20, 2008
posts:133
votes: 0


Hi rocknbil,

Long time no hear, cant count on onw hand how many times you have helped me out.

Anyways, I have figured it out and is running fine.

thanks anyway.

Take care-have a great Easter

geoffb

10:56 pm on Apr 11, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


And . . . . what did you do? (For those asking the same q! :-) )
6:44 am on Apr 12, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 20, 2008
posts:133
votes: 0


In this section of the script: Advanced Settings required fields-you will find the setting for required fields.

In between the enclosed brackets place a name of the form field you would like to make required, either just any entry, either letters or numbers in the @required_fields.

So If you want a name and comments text boxed filled in, add a name="" to your form field, like so:

<input name="surname" id="surname" type="text" />
<textarea name="comments" cols="35" rows="5" id="comments"></textarea>

And ensure that this corresponds with what you have in the enclosed brackets on the required_fields. So above for instance I have a text box for customers name, and a text area for comments, and have made them both required fields.

If you have a form field to collect an email address, then you just do the same thing.

<input name="mailadd" id="email" type="text" />

As you can see, I have named the form field for email collection as "mailadd" and also called it the same in the script below.

my @required_fields = (surname,comments);
my @required_fields_numbers = ();
my @required_fields_email = (mailadd);

If you have a field for telephone number the same applies.

Hope helps anyone.

geoffb

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members