Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
support html5 required attribute for the comments form
Now that both Opera and Firefox 4b6 [1] support the required attribute [2] for comments forms, I patched TXP to make use of them.
Patch available here. Screenshot of a default TXP comment form (with the default styling provided by Gecko – note that the disabled submit button should not be flagged, that is a currently an open bug…)
While I was at it, I also added type="email"
[3] and type="url"
[4] for the appropriate fields (android/iOS/… users may appreciate that).
The patch generates the following html code
<input type="text" value="" name="name" size="25" class="comment_name_input" id="name" required>
<input type="email" value="" name="email" size="25" class="comment_email_input" id="email" required>
<input type="url" value="" name="web" size="25" class="comment_web_input" id="web">
Completely un-styled sample form
—-
[1] and, I believe, IE 9. WebKit is working on the issue
[2] http://dev.w3.org/html5/spec/Overview.html#the-required-attribute
[3] http://dev.w3.org/html5/spec/Overview.html#e-mail-state
[4] http://dev.w3.org/html5/spec/Overview.html#url-state
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline