2008年8月12日火曜日

携帯 入力ヘルパー

携帯サイトでフォーム入力をする際、入力モードが自動的に変わるのはPCサイト以上に大切だと思っています。

input要素の属性で文字入力モードを指定する場合、htmlだと





i-modeとez-web

istyle=1 (全角かな)

istyle=2 (半角カナ)

istyle=3 (英字/半角文字)

istyle=4 (数字/半角文字)

softbank

mode="hiragana" (全角かな)

mode="katakana" (半角カナ)

mode="alphabet" (英字/半角文字)

mode="numeric" (数字/半角文字)

 で良かったのですが、xhtmlではこれが機能しません。

 そこで登場するのが-wap-input-formatです。



i-modeとsoftbank

style="-wap-input-format:'*'"(全角かな)

→エスケープすると style="-wap-input-format:"*<ja:h>""

style="-wap-input-format:'*'"(半角カナ)

→エスケープすると style="-wap-input-format:"*<ja:hk>""

style="-wap-input-format:'*'"(英字/半角文字)

→エスケープすると style="-wap-input-format:"*<ja:en>""

style="-wap-input-format:'*'"(数字/半角文字)

→エスケープすると style="-wap-input-format:"*<ja:n>""

ez-web

style="-wap-input-format:*M;"(全角かな)

style="-wap-input-format:*m;"(英字/半角文字)

style="-wap-input-format:*N;"(数字/半角文字)



 という具合になります。

 これを3キャリア共通にするためには;;で区切ってひとつながりに書くと大丈夫のようです。





style="-wap-input-format:"*<ja:h>";-wap-input-format:*M;"(全角かな)

style="-wap-input-format:"*<ja:hk>";-wap-input-format:*M;"(半角カナ)(ez-webは半角カナはなし)

style="-wap-input-format:"*<ja:en>";-wap-input-format:*m;"(英字/半角文字)

style="-wap-input-format:"*<ja:n>";-wap-input-format:*N;"(数字/半角文字)

0 件のコメント:

コメントを投稿