[wp-hackers] Weird behaviour with comment_author_url and input placeholders
SWORD Studios
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.
>
> eg.
> <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
occurs
> 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:
> http://EnterWebsiteAddress(optional)
>
> 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
getting
> 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.
>
> Cheers,
> Lynne
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list