Javascript for generating month and year dropdowns
<pre><code>&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
if(window.addEventListener){
   window.addEventListener('load',setDay,false);
 }
else { 
if(window.attachEvent){
   window.attachEvent('onload',setDay);
  }
 }

function setDay(){

document.forms[0].elements['mes'].onchange=function() {
   n= parseFloat(this.getAttribute("label"))+1;
   opt=[];
   txt=[];
   $("#dia &gt; option").remove();
for(c=1;c&lt;n;c++) {  

   opt[c]=document.createElement('option');
   txt[c]=document.createTextNode(c);
   opt[c].value=c;
   opt[c].setAttribute('name', 'dias');
   opt[c].appendChild(txt[c]);
   document.forms[0].elements['dia'].appendChild(opt[c]);
   }
  }
 }
&lt;/script&gt;
-----
&lt;select name="mes"&gt;
 &lt;option value="z"&gt;Mês&lt;/option&gt;
 &lt;option value="31" label="31"&gt;Janeiro&lt;/option&gt;
 &lt;option value="29" label="31"&gt;Fevereiro&lt;/option&gt;
 &lt;option value="31" label="31"&gt;Março&lt;/option&gt;
 &lt;option value="30" label="31"&gt;Abril&lt;/option&gt;
 &lt;option value="31" label="31"&gt;Maio&lt;/option&gt;
 &lt;option value="30" label="31"&gt;Junho&lt;/option&gt;
 &lt;option value="31" label="31"&gt;Julho&lt;/option&gt;
 &lt;option value="31" label="31"&gt;Agosto&lt;/option&gt;
 &lt;option value="30" label="31"&gt;Setembro&lt;/option&gt;
 &lt;option value="31" label="31"&gt;Outubro&lt;/option&gt;
 &lt;option value="30" label="31"&gt;Novembro&lt;/option&gt;
 &lt;option value="31" label="31"&gt;Dezembro&lt;/option&gt;
&lt;/select&gt;
&lt;select name="dia" id="dia"&gt;
 &lt;option value="z"&gt;Dia&lt;/option&gt;
&lt;/select&gt;

&lt;select name="ano"&gt;
 &lt;option&gt;Ano&lt;/option&gt;
 &lt;option value="2010"&gt;2010&lt;/option&gt;
 &lt;option value="2009"&gt;2009&lt;/option&gt;
 &lt;option value="2008"&gt;2008&lt;/option&gt;
 &lt;option value="2007"&gt;2007&lt;/option&gt;
 &lt;option value="2006"&gt;2006&lt;/option&gt;
 &lt;option value="2005"&gt;2005&lt;/option&gt;
 &lt;option value="2004"&gt;2004&lt;/option&gt;
 &lt;option value="2003"&gt;2003&lt;/option&gt;
 &lt;option value="2002"&gt;2002&lt;/option&gt;
 &lt;option value="2001"&gt;2001&lt;/option&gt;
 &lt;option value="2000"&gt;2000&lt;/option&gt;
 &lt;option value="1999"&gt;1999&lt;/option&gt;
 &lt;option value="1998"&gt;1998&lt;/option&gt;
 &lt;option value="1997"&gt;1997&lt;/option&gt;
 &lt;option value="1996"&gt;1996&lt;/option&gt;
 &lt;option value="1995"&gt;1995&lt;/option&gt;
 &lt;option value="1994"&gt;1994&lt;/option&gt;
 &lt;option value="1993"&gt;1993&lt;/option&gt;
 &lt;option value="1992"&gt;1992&lt;/option&gt;
 &lt;option value="1991"&gt;1991&lt;/option&gt;
 &lt;option value="1990"&gt;1990&lt;/option&gt;
 &lt;option value="1989"&gt;1989&lt;/option&gt;
 &lt;option value="1988"&gt;1988&lt;/option&gt;
 &lt;option value="1987"&gt;1987&lt;/option&gt;
 &lt;option value="1986"&gt;1986&lt;/option&gt;
 &lt;option value="1985"&gt;1985&lt;/option&gt;
 &lt;option value="1984"&gt;1984&lt;/option&gt;
 &lt;option value="1983"&gt;1983&lt;/option&gt;
 &lt;option value="1982"&gt;1982&lt;/option&gt;
 &lt;option value="1981"&gt;1981&lt;/option&gt;
 &lt;option value="1980"&gt;1980&lt;/option&gt;
 &lt;option value="1979"&gt;1979&lt;/option&gt;
 &lt;option value="1978"&gt;1978&lt;/option&gt;
 &lt;option value="1977"&gt;1977&lt;/option&gt;
 &lt;option value="1976"&gt;1976&lt;/option&gt;
 &lt;option value="1975"&gt;1975&lt;/option&gt;
 &lt;option value="1974"&gt;1974&lt;/option&gt;
 &lt;option value="1973"&gt;1973&lt;/option&gt;
 &lt;option value="1972"&gt;1972&lt;/option&gt;
 &lt;option value="1971"&gt;1971&lt;/option&gt;
 &lt;option value="1970"&gt;1970&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<hr>

<p>So my problem is that I want to catch the values with PHP in a form using POST and I have a problem in catching the month value, because I wanted that month had their own value and not the value of the number of days that corresponds to that month. I changed this script a little bit, even made on thing better but now I'm stuck.</p>

<p>Can anyone help me? Thanks</p>
