Field Required via Script

Field Required via Script

Hello Guys,

i have two fields for Text and this Code.

if (((input.Acount_Code_1A  !=  "")  &&  (input.Acount_Code_1A  !=  null))
{
    if (!(input.Acount_Code_1A).toString().matches("[a-zA-Z0-9]{2,15}"))
    {
        alert ("Account_Code_1A should be between 2 and 15!");
        cancel submit;
    }
}


how can i write the code so the user always has to fill one of the two fields without which there are pre-mandatory.

Thanks

Carsten