Author Topic: Shopper fields with placeholder  (Read 2552 times)

gba

  • Jr. Member
  • **
  • Posts: 303
Shopper fields with placeholder
« 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.

gba

  • Jr. Member
  • **
  • Posts: 303
Re: Shopper fields with placeholder
« Reply #1 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

patbe60

  • Beginner
  • *
  • Posts: 48
Re: Customerfields with placeholder
« Reply #2 on: November 11, 2018, 14:10:41 pm »
Insert the following code into edit_address_userfields.php

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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4367
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Customerfields with placeholder
« Reply #3 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.

gba

  • Jr. Member
  • **
  • Posts: 303
Re: Shopper fields with placeholder
« Reply #4 on: November 13, 2018, 09:11:11 am »
Insert the following code into edit_address_userfields.php

Code: [Select]
$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

  • Jr. Member
  • **
  • Posts: 303
Re: Shopper fields with placeholder
« Reply #5 on: November 13, 2018, 09:13:19 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9779
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Customerfields with placeholder
« Reply #6 on: November 13, 2018, 10:57:48 am »
Quote
In 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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4367
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Customerfields with placeholder
« Reply #7 on: November 13, 2018, 12:06:33 pm »
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

  • Jr. Member
  • **
  • Posts: 303
Re: Shopper fields with placeholder
« Reply #8 on: November 13, 2018, 12:11:28 pm »
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

  • Jr. Member
  • **
  • Posts: 303
Re: Shopper fields with placeholder
« Reply #9 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

gba

  • Jr. Member
  • **
  • Posts: 303
Re: Shopper fields with placeholder
« Reply #10 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