wp-e-commerce / WP-e-Commerce

WP eCommerce - The most popular independent eCommerce platform for WordPress
https://wpecommerce.org
GNU General Public License v2.0
215 stars 217 forks source link

Placeholder text set as INPUT values in Theme Engine v2 #2298

Closed leewillis77 closed 7 years ago

leewillis77 commented 7 years ago

On branch-4.0.0 it seems that the placeholder values for the checkout forms aren't using raw HTML placeholder attributes, but a Javascript-based solution. There are issues with this because the placeholder text seems to get set as the input field's value.

To reproduce:

Expected behaviour: Empty string returned

Actual behaviour: "First name" returned.

That seems odd and will cause issues with anything that integrates with the checkout fields via JS.

JustinSainton commented 7 years ago

@leewillis77 Good report! My hunch is that this was introduced when the floating label functionality was introduced. If that's the case, we'll need to address this for sure.

@lizkaraffa Let me know if you can confirm and resolve. Thanks!

mihaijoldis commented 7 years ago

lee is right here. If you go to a checkout page for the first time and don't enter any info in the fields most of them will be "validated" since they do have a value of the placeholder which is wrong. You could receive an order for customer FIrst Name Last Name

JustinSainton commented 7 years ago

"Lee is right here".

^ story of my life.

leewillis77 commented 7 years ago

Being right in hindsight is easy ;)

lizkaraffa commented 7 years ago

Ok I think this fixed the issue. https://github.com/wp-e-commerce/WP-e-Commerce/tree/bug/form-placeholders good catch @leewillis77

JustinSainton commented 7 years ago

Merged, and seems to be working as expected!