PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

html_select_date | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

html_select_date

Attribute NameTypeRequiredDefaultDescription
prefixstringNoDate_what to prefix the var name with
timetimestamp/YYYY-MM-DDNocurrent time in unix timestamp or YYYY-MM-DD formatwhat date/time to use
start_yearstringNocurrent yearthe first year in the dropdown, either year number, or relative to current year (+/- N)
end_yearstringNosame as start_yearthe last year in the dropdown, either year number, or relative to current year (+/- N)
display_daysbooleanNotruewhether to display days or not
display_monthsbooleanNotruewhether to display months or not
display_yearsbooleanNotruewhether to display years or not
month_formatstringNo%Bwhat format the month should be in (strftime)
day_formatstringNo%02dwhat format the day output should be in (sprintf)
day_value_formatstringNo%dwhat format the day value should be in (sprintf)
year_as_textbooleanNofalsewhether or not to display the year as text
reverse_yearsbooleanNofalsedisplay years in reverse order
field_arraystringNonull if a name is given, the select boxes will be drawn such that the results will be returned to PHP in the form of name[Day], name[Year], name[Month].
day_sizestringNonulladds size attribute to select tag if given
month_sizestringNonulladds size attribute to select tag if given
year_sizestringNonulladds size attribute to select tag if given
all_extrastringNonulladds extra attributes to all select/input tags if given
day_extrastringNonulladds extra attributes to select/input tags if given
month_extrastringNonulladds extra attributes to select/input tags if given
year_extrastringNonulladds extra attributes to select/input tags if given
field_orderstringNoMDYthe order in which to display the fields
field_separatorstringNo\nstring printed between different fields
month_value_formatstringNo%mstrftime format of the month values, default is %m for month numbers.

html_select_date is a custom function that creates date dropdowns for you. It can display any or all of year, month, and day.

Example 8-10. html_select_date

{html_select_date}


OUTPUT:

<select name="Date_Month">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12" selected>December</option>
</select>
<select name="Date_Day">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
<option value="5">05</option>
<option value="6">06</option>
<option value="7">07</option>
<option value="8">08</option>
<option value="9">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13" selected>13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="Date_Year">
<option value="2001" selected>2001</option>
</select>

Example 8-11. html_select_date


{* start and end year can be relative to current year *}
{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1" display_days=false}

OUTPUT: (current year is 2000)

<select name="StartDateMonth">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12" selected>December</option>
</select>
<select name="StartDateYear">
<option value="1999">1995</option>
<option value="1999">1996</option>
<option value="1999">1997</option>
<option value="1999">1998</option>
<option value="1999">1999</option>
<option value="2000" selected>2000</option>
<option value="2001">2001</option>
</select>
忘却曲線を使ってこの関数を確実に記憶に残す

フォーラムで「html_select_date」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | html_select_date」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: