En curso

Check field content depending on other field entries

I have already an online booking form. The Form works fine now and I would like to add on one more issue, but the code ignores what I want to check. I have 4 fields: "arrival", "departure", "no. of persons" and "comments" to check.

Scenario 1:

All field mentioned above are empty: Workes fine and message appears: "You have not provided any booking details".

Scenario 2:

If arrival (date_start) and departure (date_end) is entered, there should be at least an entry either in the field "comment", or in the field "pax". If not, there should be a message: "You have not provided sufficient booking details".

INSTEAD: The form is sent, which should NOT be the case !

The code is currently:

# all fields are empty : arrival, departure, pax and comments ==> error (works fine)

if(empty($data_start) && empty($data_end) && empty($pax)&& empty($comment)){

exit("You have not specified any booking details");

exit;

}

#If arrival and departure date is entered, there should be at least an entry either in the field "comment", or in the field "pax".

if(!isset($data_start) && !isset($data_end) && empty($pax) && empty($comment)){

exit("You have not provided sufficient booking details.");

exit;

}

The form is attached and can be tested at [url removed, login to view]

Can someone please check and tell me what's wrong with the code ?

Habilidades: PHP, Arquitectura de software

Ver más: it workes, it field, code check online, check code online, check c code online, pax, code check, check, depending, booking issue, add field code, check attached, online booking architecture, check date online, contact details persons, please check can, architecture online booking, entry content, software comment, form field, booking php form, php booking online, form entry software, comment software, architecture works

Información del empleador:
( 3 comentarios ) Phuket, Thailand

ID de proyecto: #819434

Adjudicado a:

ollerenshaw

I've taken a look and it's quite simple to fix the code to do what you want. Do you also want to modify the web-page code so that a message box comes up (similar to invalid email, name, or verification) stating that n Más

$30 USD en 1 día
(1 comentario)
1.0

12 los freelancers están ofertando un promedio de $31 para este trabajo.

zeke

I am an expert PHP programmer, ready to start immediately and finish within less than a hour.

$30 USD en 0 días
(166 comentarios)
7.1
MarcusPan

I've GOT A SOLUTION right now!

$30 USD en 0 días
(135 comentarios)
6.5
diegou

hi, expert, can do this fast

$30 USD en 1 día
(38 comentarios)
5.9
barca2045

I can fix this right now.

$30 USD en 0 días
(55 comentarios)
5.6
jarvisliu

Please check your PM

$40 USD en 1 día
(32 comentarios)
5.6
spiczek

Please check the PM.

$30 USD en 0 días
(4 comentarios)
3.1
warchildmd

I can do it in 30 minutes

$30 USD en 1 día
(1 comentario)
2.5
renphp

Ready to complete this job. Can start ASAP. regards

$30 USD en 1 día
(3 comentarios)
2.2
devphp

Please see PM!

$30 USD en 0 días
(0 comentarios)
0.0
mmarc

Please check PM

$30 USD en 0 días
(0 comentarios)
0.0
Spazbot

Would be glad to give you the fix.

$30 USD en 1 día
(0 comentarios)
0.0