WordPressコメント欄のaria-requiredについて

In: HTML| WordPress

24 1月 2009

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, …)

Comment Form

About this blog

ここは、SE見習いである私ことdaceloが、日夜習得していくシステム関連の備忘録、phpやWordPressTipsのネタ、あるいはSEOやWebマーケティング関連の雑感を投稿するブログです。 平日は大体毎日投稿しています。土日は休業日です。

紹介

カウンター

昨日:951 今日:496 合計;273600

カレンダー

2010年8月
« 7月    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Translator

Japanese flagEnglish flagIndonesian flag
By N2H