As with most of your problems you are barking up the wrong tree.
Why not use the actual value you get from the form to check whether you
have a valid month?
Do you understand why "0" is submitted instead of "=========="?
No, this is exactly what i do not understand.
months = ( '==========', 'ΙανουάÏιος', 'ΦεβÏουάÏιος', 'ΜάÏτιος',
'ΑπÏίλιος', 'Μάϊος', 'ΙοÏνιος',
'ΙοÏλιος', 'ΑÏγουστος', 'ΣεπτÎμβÏιος', 'ΟκτώβÏιος',
'ÎοÎμβÏιος', 'ΔεκÎμβÏιος' )
This is a tuple containign months. Then we have this:
for i, month in enumerate(months):
print('<option value="%s"> %s </option>' % (i, month) )
i is assiciated to month in similar fashion as a dic's key to it's value
i = the increasing counter after each iteration in the loop
month = just the displayed month.
when iteration happens we get this:
value 0 for month '=========='
value 1 for month 'ΙανουάÏιος'
......
......
value 12 for month 'ΔεκÎμβÏιος'
So when '==========' is being selected as month from the user value 0 is
beign returned, but what i need is the string '==========' itself, not
the value.
the year var have no prblem, is the month that always fails the if()
condition branch.