Last reviewed: Not reviewed


A convenient method for producing a list of months in an HTML form field using the current language settings.


string  monthSelectList ( string $tag_name, string $tag_attribs, mixed $selected )

is the name attribute of the HTML <select> tag..
is a string containing any additional attributes that you want to assign to the HTML <select> tag..
is either a string value for a single value select list or an array for a multiple value select list.  Note that the values used here are the month numbers with a leading zero for months 1 to 9.



$html = mosHTML::monthSelectList( 'month', 'class="inputbox"', '01' );
echo $html;

which produces:

<select name="month" class="inputbox">
  <option value="01" selected="selected">January</option>
  <option value="02">February</option>
  <option value="03">March</option>
  <option value="04">April</option>
  <option value="05">May</option>
  <option value="06">June</option>
  <option value="07">July</option>
  <option value="08">August</option>
  <option value="09">September</option>
  <option value="10">October</option>
  <option value="11">November</option>
  <option value="12">December</option>

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Saturday, 03 September 2005 )