News:

Looking for documentation? Take a look on our wiki

Main Menu

[SOLVED] Shopper fields with placeholder

Started by gba, November 23, 2017, 12:50:55 PM

Previous topic - Next topic

gba

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.

gba

#1
Hi!

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

Kind regards,
Gerald

patbe60

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

Studio 42

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.

gba

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

gba

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

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

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

gba

#8
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  ;)

gba

#9
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

gba

Hi all!

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

Kind regards,
Gerald