I`ve made many mods in my installation of php-residence but now im in a stuck...

I need to add three more loops in prenota.php or clienti.php:
- if number of persons was entered
- if "reservation type" is selected (res. type - it`s my own mod)
- if "reservation-confirmation date" was entered (also own mod, using tigra-calendar - as replacement your "comment" field)
But... i don`t know where exactly i should put that..
I`m not a javascript-master, so - i tried to do it in php - near your "tipotarifa" select box - buy it doesn`t works... Could you give me some clues?
- thx, regards -