PHP Form - How to produce error msg when *required field is not filled in

I have a built a site with a simple feedback form.

Test site is here:

http://www.cmlcampaigns.co.uk/hub/enquiryform.php

The client insists certain fields me be filled in - *required

I also agree, I have set the form to produce a page for each individual error - works fine!!!

However if you fill in the form and miss out a *required field, e.g. Name - then form still submits??

How can I stop this happening, or at least stop the form from being sent if the mandatory field are not filled in.

Is there a way to produce an error message to say that the required fields have not been completed correctly???

Thanks guys


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What are you using for your form handler? You say PHP form, but are
you using an Action or a hand-rolled script on the server to manage
the form submission?

Walter

On Jan 22, 2009, at 8:49 AM, Mr worm wrote:

I have a built a site with a simple feedback form.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you download and use the PHP easiForm actions then they will handle
all of this for you, there is a small cost for easiForm but it will
save you a lot of time.
Tutorial: Tutorial: easiForm With Freeway

Example contact form that uses the PHP easiBase actions:
http://www.easibase.com/easicontact.php

Just press submit without filling in any fields and you can see the
errors returned.

If your server supports ioncube then the easiForm suite will save you
a lot of time.

HTH
Mike

On Jan 22, 2009, at 2:49 PM, Mr worm wrote:

I have a built a site with a simple feedback form.

Test site is here:

http://www.cmlcampaigns.co.uk/hub/enquiryform.php

The client insists certain fields me be filled in - *required

I also agree, I have set the form to produce a page for each
individual error - works fine!!!

However if you fill in the form and miss out a *required field, e.g.
Name - then form still submits??

How can I stop this happening, or at least stop the form from being
sent if the mandatory field are not filled in.

Is there a way to produce an error message to say that the required
fields have not been completed correctly???

Thanks guys


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s also the PHP Form Action at PHP Form Action - ActionsForge
and Validate form Suite at: ActionsForge - The Complete Repository of Freeway Actions

I have used both these and easiForm successfully, with a current bias
to easiForm which gives a simple one-stop option.

Choice depends on what you need to achieve.

Colin

On 22 Jan 2009, at 14:00, Mike B wrote:

If you download and use the PHP easiForm actions then they will
handle all of this for you, t

On Jan 22, 2009, at 2:49 PM, Mr worm wrote:

Is there a way to produce an error message to say that the required
fields have not been completed correctly???


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m using the Page action - PHP Feedback Form and have applied a set page for each error.

Is this not possible using this action/method Walt?

As Mike has also posted, I am open to suggestions or an alternative.

Chris


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I haven’t used that Action myself. My understanding of it from a distance is that you set a single error page to catch all errors, and the handler will not send mail if a required element is not filled in. The form will certainly submit, but there won’t be any output.

Form page → submit → decision:

Valid: send mail, redirect to success page.

Invalid: error page, directions to correct

That’s the tree as far as I understand it. Tim Plumb should be awake in another hour or so, maybe he can pipe up about this then. (He’s in the Seattle area/time zone.)

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry, I missed our original mail. The action only really cares about two fields
if they exist; name and email. If these field names exit and they don’t contain
a value then the PHP code will throw the user to the error page.
If you need to any further validation I would suggest you add the Validate Form
Suite (ActionsForge - The Complete Repository of Freeway Actions) and do
your value checking before the form gets submitted.
Regards,
Tim.

Quoting Mr worm email@hidden:

I have a built a site with a simple feedback form.

Test site is here:

http://www.cmlcampaigns.co.uk/hub/enquiryform.php

The client insists certain fields me be filled in - *required

I also agree, I have set the form to produce a page for each individual error

  • works fine!!!

However if you fill in the form and miss out a *required field, e.g. Name -
then form still submits??

How can I stop this happening, or at least stop the form from being sent if
the mandatory field are not filled in.

Is there a way to produce an error message to say that the required fields
have not been completed correctly???

Thanks guys


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options