Hiding Fields depending on the input of a lookup field

Hiding Fields depending on the input of a lookup field

I am trying to hide or show two fields in a form called PPE _Distribution.  I have hidden the two fields on load and that works but then I want theform to show Select_Employee field when the Select_Location field is "Employee" and to show Select_Job_Number  when the "Select_Location" field is Job Numbers.   The Location field is a lookup field (drop down) from the form Location and that field is called Stock_Location.  I am pretty new to coding and deluge script.  I have tried several examples from the forum and the deluge script resources.  I'd appreciate any help.

One example I have tried is the following.  I keep getting an error that one side is Boolean and the other string?

x = Location[Stock_Location == input.Select_Location];

if (Select_Location == "Employee")

{

show Select_Employee ;

}

else

{

hide Select_Employee ;

}

if (Select_Location = "Job Numbers" )

{

show Select_Job_Number ;

}

else

{

hide Select_Job_Number ;

}