$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
WordPressのカスタマイズとプラグイン、CSSテクニック、SEOの話題など。
WordPressのテーマ作成中。
HTML Validatorに入れたら、コメントフォーム周りで「そんな要素はない」と叱られる。
見てみると、inputにaria-required=true という設定がある。
どうやらこれはアクセシビリティーに関する指定で、IE8からサポートされるらしいが、現状では特に意味を成さないので削除。
下記サイトの説明によると、
「フォームの必須要素に指定すると、空白のまま送信しようとするとエラーを出力する」
とのこと。
今までこういうフォームバリデートはJavaScriptかサーバーサイドのプログラム側でやるしかなかったけど、HTMLレベルでやってくれるようになるとしたらラクでいいですね。
大丈夫かなIE8…。
The aria-required property indicates which input fields of a form must be filled in before it can be submitted. If the user attempts to submit the form without the required information, you may set aria-invalid to indicate the error.
Note For cross-browser compatibility, always use the WAI-ARIA attribute syntax to access and modify ARIA properties, for example object.setAttribute(“aria-valuenow”, newValue).
(ariaRequired Property (A, ABBR, ACRONYM, …))
Related posts:
Related posts brought to you by Yet Another Related Posts Plugin.
ここは、SE見習いである私ことdaceloが、日夜習得していくシステム関連の備忘録、phpやWordPressTipsのネタ、あるいはSEOやWebマーケティング関連の雑感を投稿するブログです。 平日は大体毎日投稿しています。土日は休業日です。
1 Response to WordPressコメント欄のaria-requiredについて
トラックバックURL:2moi
10月 16th, 2009 at 4:46 PM
フォーム欄を空白のまま送信しようとするとエラーを出力する要素(IE8サポート)