i cant understand why this simple function doesnt work in the way i want it to work :)

```
c = document.form.product_catid.selectedIndex;
if (document.form.product_name.value == "" && document.form.product_catid[c].value == "")
{
    alert ("Please, define at least product name or product category !");
    return false;
}
else if (!(document.form.product_name.value == "")) 
{
    return true;
}
else if (!(document.form.product_catid[c].value == "")) 
{
    return true;
}
else
{ 
    alert ("Please, dont define two of them at the same time!");
    return false; 
}
return true;

```

all i want is when input with name product\_name is filled OR select with name product\_catid is selected, the function is returned true, but if none of them or both are defined, i want it to alert two different alerts ) thank you all for the help, i really appreciate it!