I want to add red borders to required fields, if the fields are empty. The ShowSelection() function is run when the interface is loaded, and everytime the interface is refreshed. I have the following form fields: First Name, Last Name, Birth Date, Email, Cell Phone, Address, Post Num, Post City, and Consent Checkbox. If Consent Checkbox is checked, the other fields are required. These required fields should then have a red border. There are some exceptions; when the Email field is filled out, the Address (inc. Post Num and City) are not required anymore. And vice versa, when Address is filled out, the Email field is not required.
The code is written for Siebel OpenUI, which has some proprietary functionality such as "GetPM()", "GetInputName()" etc. The inputRedborder class contains red 2px border.