How to retain the value of a text box?
<p>This is the content on my view page and i want to replace the value from "0" when the monthfunc() is called...the monthfunc() is given below the view content</p>

<pre><code>&lt;tr&gt;
&lt;td&gt;
&lt;input type="submit" name="monthplus" id="monthplus" onClick="return monthfunc('monthplus');"  value="&gt;&gt;&gt;&gt;&gt;&gt;"&gt;
&lt;input type="hidden" name="monthnum" id="monthnum" value="1"&gt;
&lt;input type="text" name="monthname" id="monthname" value="0"  value="&lt;? echo $month;?&gt;" &gt;
&lt;input type="submit" name="monthminus" id="monthminus" onClick="return monthfunc('monthminus');" value="&lt;&lt;&lt;&lt;&lt;&lt;"&gt;
&lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>My script is</p>

<pre><code>function monthfunc(mnth)
{
 if(mnth == 'monthplus')
 {
  var yn = document.getElementById('monthnum').value;
  ynpo = parseInt(yn)+1;
  if(ynpo==13)
  {
   ynpo=1;
  }

 }

 else if(mnth == 'monthminus')
 {
  var yn = document.getElementById('monthnum').value;
  ynpo = parseInt(yn)-1;
  if(ynpo==0)
  {
   ynpo=12;
  }
 }
  if(ynpo ==1)
  {
    document.getElementById('monthname').value = 'january';
    document.getElementById('monthnum').value = ynpo;
    return true;
  }
  else if(ynpo ==2)
  {
    document.getElementById('monthname').value = 'february';
    document.getElementById('monthnum').value = ynpo;
    return true;
  }
  else if(ynpo ==3)
  {
    document.getElementById('monthname').value = 'March';
    document.getElementById('monthnum').value = ynpo;
    return true;
  }
  return false;

}
</code></pre>

<p>How can i replace The value with the value like january february etc..
 Actually i can change the values but cannot retain the values...
 i want to retain the values ,,,How to do that</p>
