Check field content depending on other field entries

Ολοκληρωμένο Αναρτήθηκε Oct 10, 2010 Πληρώθηκε κατά την παράδοση
Ολοκληρωμένο Πληρώθηκε κατά την παράδοση

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 [login to view URL]

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

PHP Αρχιτεκτονική Λογισμικού

Ταυτότητα Εργασίας: #819434

Σχετικά με την εργασία

11 προτάσεις Απομακρυσμένη εργασία Ενεργό Oct 11, 2010

Ανατέθηκε στον:

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 Περισσότερα

$30 USD σε 1 μέρα
(1 Κριτική)
1.0

11 freelancers κάνουν προσφορές κατά μέσο όρο $31 για αυτή τη δουλειά

MarcusPan

I've GOT A SOLUTION right now!

$30 USD σε 0 μέρες
(133 Αξιολογήσεις)
6.5
diegou

hi, expert, can do this fast

$30 USD σε 1 μέρα
(40 Αξιολογήσεις)
6.0
jarvisliu

Please check your PM

$40 USD σε 1 μέρα
(32 Αξιολογήσεις)
5.6
barca2045

I can fix this right now.

$30 USD σε 0 μέρες
(55 Αξιολογήσεις)
5.6
spiczek

Please check the PM.

$30 USD σε 0 μέρες
(4 Αξιολογήσεις)
3.1
warchildmd

I can do it in 30 minutes

$30 USD σε 1 μέρα
(2 Αξιολογήσεις)
2.6
renphp

Ready to complete this job. Can start ASAP. regards

$30 USD σε 1 μέρα
(3 Αξιολογήσεις)
2.2
devphp

Please see PM!

$30 USD σε 0 μέρες
(0 Αξιολογήσεις)
0.0
mmarc

Please check PM

$30 USD σε 0 μέρες
(0 Αξιολογήσεις)
0.0
Spazbot

Would be glad to give you the fix.

$30 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0