I am trying to make two different buttons either be visible or invisible depending on if a certain text field has something typed into it or not:
1) If the text field is left blank, I want the "SubmitToHR" button visible and the "SubmitToHRccEmp" button to remain invisible.
2) If the text field is filled in, I want the "SubmitToHR" button to be invisible, and the "SubmitToHRccEmp" button to be visible.
With the below code, number 1) works, but 2) does not (I can make the SubmitToHR button invisible, but the SubmitToHRccEmp button does not become visible. Can someone help me find out what I'm doing wrong? Based on everything I've read, I believe the code I have is correct, it just isn't working. Thank you!
//Email field validation for cc Employee
if (Page1.EmployeeEmail.rawValue == null)
Page1.SubmitToHR.presence = "visible";
Page1.SubmitToHRccEmp.presence = "invisible";
else if (Page1.EmployeeEmail.rawValue !== null)
Page1.SubmitToHR.presence = "invisible";
Page1.SubmitToHRccEmp.presence = "visible";