Might just be your logic:
if (firstform.outmonth.value !="12" && firstform.retmonth.value !="01") {
try passing in
12, 01 //false
x, 01 //false
12, x //false
x, x //true
So it is only true if the first one isn't 12 AND the second isn't 01. Is that what you are...