Added javascript functions to prevent the system from crashing when some fields for drugs prescribed are left blank