Mandatory Fields through script

Mandatory Fields through script

hello

im currently writing an onboarding form for work but im having trouble with makeing a mandatory field for certain companys but not others ive tried a different couple ways but im absolutely stumped on it 

if(input.Company  =  "Company Name")
{
if(input.First_Name  =  null)
{
alert ("Emergency Contact Required");
cancel submit;
}
}

ive tried this and replacing null with "" and it still wont work

please assist