VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: gba on November 23, 2017, 12:50:55 PM

Title: [SOLVED] Shopper fields with placeholder
Post by: gba on November 23, 2017, 12:50:55 PM
Hi VM team!

HTML5 has introduced the 'placeholder' attribute to INPUT elements in 2014.
In the meantime it has got to be "state of the art" to use this attribute instead of default values, when there is no default value but just the need of giving the user a hint what data is requested.
VM should provide shop administrators with such a placeholder setting.
What do you think about that?

Kind regards,
Gerald

EDIT: For clarification I modified my post titles in this thread from "Customerfields with placeholder" to "Shopper fields with placeholder". Sorry for this confusion.
Title: Re: Shopper fields with placeholder
Post by: gba on April 05, 2018, 15:20:43 PM
Hi!

I am wondering, if the placeholder attribute will be implemented in VM shopper fields soon?

Kind regards,
Gerald
Title: Re: Customerfields with placeholder
Post by: patbe60 on November 11, 2018, 14:10:41 PM
Insert the following code into edit_address_userfields.php

$field['formcode'] = str_replace('type="', ' alt="'.$field['title'].'" placeholder="'.$field['title'] . ($field['required'] ? ' *' : '').'" type="', $field['formcode']);
This should work.
Title: Re: Customerfields with placeholder
Post by: Studio 42 on November 11, 2018, 17:29:00 PM
Hi gba,
My product customfields plugin shortcodes can use HTML5 placehollder(and many other features) see https://shop.st42.fr/en/products/shortcodes.htm the "Cart Input" sample is what you need.
Title: Re: Shopper fields with placeholder
Post by: gba on November 13, 2018, 09:11:11 AM
Quote from: patbe60 on November 11, 2018, 14:10:41 PM
Insert the following code into edit_address_userfields.php

$field['formcode'] = str_replace('type="', ' alt="'.$field['title'].'" placeholder="'.$field['title'] . ($field['required'] ? ' *' : '').'" type="', $field['formcode']);
This should work.

Hi!
Thank you for that "hack".
Actually I do not want to change to VM core, nor do I want to create an override.
In my opinion the placeholder tag should be provided by VM.
Title: Re: Shopper fields with placeholder
Post by: gba on November 13, 2018, 09:13:19 AM
Quote from: Studio 42 on November 11, 2018, 17:29:00 PM
Hi gba,
My product customfields plugin shortcodes can use HTML5 placehollder(and many other features) see https://shop.st42.fr/en/products/shortcodes.htm the "Cart Input" sample is what you need.

Hi!
Thank you for your hint.
Your plugin seems to be mighty when I want to add a placeholder tag to product custom fields.
Actually this thread is about VM shopper fields - this is something different.
Title: Re: Customerfields with placeholder
Post by: GJC Web Design on November 13, 2018, 10:57:48 AM
QuoteIn my opinion the placeholder tag should be provided by VM.

VM is coded completely by a volunteer team  - the idea is if u would like this functionality you can code it and submit it here and it may find its way into the core if your code is of production standard
Title: Re: Customerfields with placeholder
Post by: Studio 42 on November 13, 2018, 12:06:33 PM
Quote from: gba on November 13, 2018, 09:13:19 AM
Hi!
Thank you for your hint.
Your plugin seems to be mighty when I want to add a placeholder tag to product custom fields.
Actually this thread is about VM customer fields - this is something different.
Sorry, i have misread the "customer" in the tittle
Title: Re: Shopper fields with placeholder
Post by: gba on November 13, 2018, 12:11:28 PM
Quote from: GJC Web Design on November 13, 2018, 10:57:48 AM
VM is coded completely by a volunteer team  - the idea is if u would like this functionality you can code it and submit it here and it may find its way into the core if your code is of production standard

See it as feature request  ;)
Title: Re: Shopper fields with placeholder
Post by: gba on September 18, 2019, 15:57:56 PM
Hi VM fans!

Who would like to have this neat little feature - or better necessity in these times - in the next VM version?
Looking forward to your positive feedback!

Gerald
Title: Re: Shopper fields with placeholder
Post by: gba on December 05, 2019, 15:45:28 PM
Hi all!

Finally this neat feature found its way into VM v3.6.10.
Thank you Max!

Kind regards,
Gerald