selectããã¯ã¹ã®optionã¿ã°ã®selectedå±æ§ã®æ¸ãæ¹
ã¢ã¯ã»ã¹æ°ãã ãã¶è½ã¡çãã¦ããã®ã§ä¹ ã ã®ã¨ã³ããªã
HTMLã®ã»ã¬ã¯ãããã¯ã¹ã«ä½¿ç¨ããoptionã¿ã°ããåæé¸æç¶æ
ã«ããã®ã« selectedå±æ§ã使ç¨ãããã¨ã«ãªãã¾ãããããã®æ¸ãæ¹ã«ã¤ãã¦ã
3ãã£ãªã¢ã®æºå¸¯ã§ä»¥ä¸ã®ãã㪠htmlãæ¸ãã¦ãã¹ããã¦ã¿ã¾ããã
<html> <head></head> <body> select test<br> <form action="/" method"get"> <select name="hoge"> <option value="1">1</option> <option value="2" selected>2</option> </select> <select name="hoge"> <option value="1">1</option> <option value="2" selected="true">2</option> </select> <select name="hoge"> <option value="1">1</option> <option value="2" selected="selected">2</option> </select> </body> </html>
ã2ãã®å¤ãããã©ã«ãé¸æããã¦ãããã¨ãããã¹ãã
ã§ãçµæã¯ä»¥ä¸ã®ããã«ãªãã¾ããã
ãã£ãªã¢ | æ©ç¨®å | 1ã¤ã | 2ã¤ã | 3ã¤ã |
DoCoMo | P905i | 2 | 2 | 2 |
DoCoMo | P906iC | 2 | 2 | 2 |
au | W31K | 2 | 1 | 2 |
au | A5401CA | 2 | 1 | 2 |
SoftBank | 904SH | 2 | 2 | 2 |
SoftBank | 602SH | 2 | 1 | 2 |
SoftBankã®2Gã¯ãããæ°è¦å¥ç´ãã§ããªãã£ããããªæ°ãããã®ã§ç¡è¦ãã¦ããã¨æãã¾ãããau㯠Win端æ«ã§ã 2ã¤ãã®è¨è¿°ã¯ç解ãã¦ããã¾ããã§ããã
ã§ããªãã§ããããªãã§ãã¯ããããã¨ããã¨ãEthnaã®ãã©ã¼ã ãã«ãã¼ãã2ã¤ãã®ãããªã³ã¼ããåãããã§ãã
Ethna_SmartyPlugin.php
ãContents of /ethna/tags/ETHNA_2_3_5/class/Ethna_SmartyPlugin.php - Ethna - SourceForge.JPã
Line:374ããã
<?php //è²ã¥ã // {{{ smarty_modifier_select /** * smarty modifier:ã»ã¬ã¯ãããã¯ã¹ç¨ãã£ã«ã¿ * * åç´ãªã»ã¬ã¯ãããã¯ã¹ã®å ´åã¯smartyé¢æ°"select"ãå©ç¨ãããã¨ã§ * ã¿ã°ãçç¥å¯è½ * * sample: * <code> * $smarty->assign("form", 1); * * <option value="1" {$form|select:"1"}>foo</option> * <option value="2" {$form|select:"2"}>bar</option> * </code> * <code> * <option value="1" selected>foo</option> * <option value="2" >bar</option> * </code> * * @param string $string ã»ã¬ã¯ãããã¯ã¹ã«æ¸¡ããããã©ã¼ã å¤ * @param string $value <option>ã¿ã°ã«æå®ããã¦ããå¤ * @return string $stringã$valueã«ãããããå ´åã¯"selected" */ function smarty_modifier_select($string, $value) { if ($string == $value) { return 'selected="true"'; } } // }}}
line:509ããã
<?php //è²ã¥ã // {{{ smarty_function_select /** * smarty function:ã»ã¬ã¯ããã£ã¼ã«ãçæ * * @param array $list é¸æè¢ä¸è¦§ * @param string $name ãã©ã¼ã é ç®å * @param string $value ã»ã¬ã¯ãããã¯ã¹ã«æ¸¡ããããã©ã¼ã å¤ * @param string $empty 空ã¨ã³ããª(ã---é¸æãã¦ä¸ãã---ãç) * @deprecated */ function smarty_function_select($params, &$smarty) { extract($params); print "<select name=\"$name\">\n"; if ($empty) { printf("<option value=\"\">%s</option>\n", $empty); } foreach ($list as $id => $elt) { printf("<option value=\"%s\" %s>%s</option>\n", $id, $id == $value ? 'selected="true"' : '', $elt['name']); } print "</select>\n"; } // }}}
ã¨ããããã§ãæºå¸¯ã§ãform_inputç³»ã®ãã«ãã¼ã使ãå ´åã«ã¯ããããä¿®æ£ãããªã©ããªãã¨ãæºå¸¯ã§ã¡ããã¨ä½¿ããªãã§ãã
W3Cçã«ã¯ã©ããªã®ã ãããï¼
ãForms in HTML documentsã
è±èªãè¦æ㧠XHTMLã®ããã¥ã¡ã³ãã¨ãã«ãã©ãçãã¦ããªãâ¦
ãã¨ã§ãããã¡ãã£ã¨èª¿ã¹ã¦ã¿ããã
ã¨ãããããhtmllintã®ã¿ã°ä¸è¦§ãè¦ãã¨ããselected = selectedãã«ãªã£ã¦ãã
ãサービス終了のお知らせã
追è¨
wideç³»IRCãµã¼ãã® %Ethnaãã£ã³ãã«ã§ãä¸è¨ã®ä»¶ãä¼ããã¨ãããmumumu_nãããå³å¹ä¿®æ£ãã¦ãã ããã¾ããã
以ä¸ã許å¯ãããã ãã¦è»¢è¼ã
ãã¯ããselected="selected" ãæ£ããã¿ããã§ãã
00:28:41
html 4.01 ã¯
00:29:05selected (selected) #IMPLIED ã ãããçç¥å¯è½ã§ãè¨å®ããæ㯠selected ã®å¤ãã¨ãã
00:29:12ããã CIã ãã case insensitive
00:29:15ã¨ãããã¨ã ã
00:29:31http://www.w3.org/TR/html401/interact/forms.html#adef-selected
00:35:33http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd 00:35:48
00:35:51
%attrs;
00:35:57selected (selected) #IMPLIED
00:36:11http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd
00:36:17ãããåæ§
00:36:38http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-frameset.dtd
00:36:42framesetãåæ§
00:36:47----
00:36:52以ä¸ãxhtml
00:40:10ã¤ãã§ã«
00:40:14XHTML Basic ãã¿ã¦ããã¨
00:40:18http://www.w3.org/TR/2000/CR-xhtml-modularization-20001020/abstract_modules.html#s_sformsmodule
00:40:21ããã ã
00:40:57http://www.w3.org/TR/2000/REC-xhtml-basic-20001219/#a_dtd
00:41:36ééãã
00:41:39http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_sformsmodule
00:41:44ææ°çã¯ãã£ã¡ã
00:42:01ã¾ãã©ã¡ãã«ãã¦ã
00:42:04option Common, selected ("selected"), value (CDATA)
00:42:07ã¨ãããã§ãselectedã ã
00:42:11ãªããã¨ãã¼
00:54:31[580] - fixed bug smarty_modifier_select plugin return value is imcompatible with HTML Standards . (thanks: maru_cc)
ããããããããªã¨ãããå ±åããã¨ãã®åå¿é度ã¯ãããã§ãã
ãã¾ãETHNA_UTF8_BRANCHã¨ããUTF8ã®ãã©ã³ãã§ãEthna 2.5.0-preview1 ã使ãã¾ãï¼
ããã¾ã ã¾ã ãã°ã¨ãæ´ãåºãã¦ãããã¨ããæ°æ©è½ã®è¿½å ã¨ãéæè¡ã£ã¦ããã®ã§ã人æ±ã«ãªã£ã¦ããã人ã¯ä½¿ã£ã¦ã¿ã¦ãã ãããã
次æãã¼ã¸ã§ã³ã«æå¾ ã