[wp-hackers] Weird behaviour with comment_author_url and input placeholders

Lynne Pope lynne.pope at gmail.com
Sun Jan 30 13:21:57 UTC 2011


I would, IF the sites were using any JavaScript for HTML5 support. At this
stage in their development the only scripts being used are WordPress' jQuery
& comments scripts.
Opera 11 has native support for placeholders but is still submitting the
placeholder text to the database. Opera also has support for checking
against patterns, but this is overridden by WordPress inputting http:// to
the url field when the form is submitted.

Other browsers are not recognising the placeholder but its still being sent
to the database.

Is there a filter I can use to override the default $linktext behaviour to
make comment_author_url recognise that if its empty then it really is empty?

Lynne


On Sat, Jan 29, 2011 at 1:35 AM, SWORD Studios <info at swordstudios.net>wrote:

> 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.
> >
>
>


More information about the wp-hackers mailing list