Developer Support »

How to make required fields  (See more user questions)

Hi .

Your script code is good. The extra code I gave you, looks good too. To
make specific form fields "required", you need to put them in the required
fields array. This is the array as you have it:

$required_fields =
array('arrival','departure','name','first-name','street','postcode','city','country','email','number-of-adults','number-of-children','animals');

You don't have the name of the radio buttons ("request-for") in there.
Should be this:

$required_fields =
array('request-for','arrival','departure','name','first-name','street','postcode','city','country','email','number-of-adults','number-of-children','animals');

...it doesn't matter where you put the field names in the array.

Do the same with the new cleaning and linen fields, put them in the above
array.

Any questions, just let me know.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

----- Original Message -----
Sent: Saturday, August 21, 2010 5:57 PM
Subject: Re: FormToEmail script


> Hi Charles,
>
> Sorry to be bothering you again but I have been testing a bit more
> and found that after the last script addition the first (the one about
> the radio-buttons and the request-for fields) no longer seems to work.
> I first assumed that I accidently damaged the code so I re-pasted the
> original code from your mail back into the script but that didn't
> help. So I am afraid I need to ask you to help me out one more
> time...and ask you for another favor...I have added 2 more options to
> the form also with radio buttons (about cleaning and linen) which we
> would also like to be required fields.
>
> Sorry again to be such a pain and I am sure it will all stop once I
> have got the thing up and running.
>
> Thank you once more for your trouble,
>
> PS: I have attached the script as I now have it. Perhaps it can help.