Hide fields based on input of lookup field

Hide fields based on input of lookup field

Hi all,

I have tried different scripts but i keep getting errors. All i am trying to do is simply hide two fields when a certain input is chosen in the lookup field.

Lookup field name is: Job_Name
Other two fields i want to hide are: Cost_Class and Cost_Codes

So,
IF "No Job" is chosen in the lookup field Job_Name, I simply want to hide Cost_Class and Cost_Codes
ELSE, show fields

I have the code as follows:

if(Job_Name.Job_Description == "No Job")
{
 hide Cost_Class;
 hide Cost_Codes;
}

I keep getting "error at null"  when saving.