[wp-hackers] Weird behaviour with comment_author_url and input placeholders
info at swordstudios.net
Fri Jan 28 12:35:00 UTC 2011
Try removing the js for html 5 support and test the form in a browser that
provides native placeholder support. I bet you'll find it'll work fine then.
On Jan 27, 2011 8:05 AM, "Lynne Pope" <lynne.pope at gmail.com> wrote:
> I've been working on two sites, one on WP 2.9.2 and another running 3.0.4.
> Both require their comment forms to be written in HTML5 using the
> placeholder tag.
> <label for="url">Website</label>
> <input type="url" name="url" id="url" value="<?php echo
> esc_attr($comment_author_url); ?>" placeholder="Enter Website Address
> (optional)" pattern="https?://.+">
> In testing, we have identified a problem with comment_author_url that
> when people do not input an URL. For some reason, WordPress is picking up
> the placeholder text and saving it into the database, like so:
> I'm having real trouble trying to identify why this is happening. The
> placeholder attribute isn't inside the input value so should not be
> picked up.
> Is this a bug? I realise HTML5 placeholder attributes are still reasonably
> new but it's not hard to have this working across current browsers so I
> suspect others will hit the same issue.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers