Nocebo Posted September 28, 2018 Share Posted September 28, 2018 Hello, I'm using Prestashop 1.7 and I'd like to know how to put "placeholder" in forms thank you in advance Link to comment Share on other sites More sharing options...
Rolige Posted October 3, 2018 Share Posted October 3, 2018 There are hundreds of forms in PS, you need to be more specific if you are looking for an answer more specific, otherwise I can tell you that in HTML you can add a placeholder like this: placeholder="my placeholder text" Link to comment Share on other sites More sharing options...
Nocebo Posted October 3, 2018 Author Share Posted October 3, 2018 Thank you for your answer, indeed there is a lot of form and I would like to do it for all. On prestashop 1.7 the forms are different I can not find the HTML of the various forms like that of adding address for example {block "form_fields"} {foreach from=$formFields item="field"} {block "form_field"} {form_field field=$field} {/block} {/foreach} {$hook_create_account_form nofilter} {/block} Link to comment Share on other sites More sharing options...
Nocebo Posted October 6, 2018 Author Share Posted October 6, 2018 Up Link to comment Share on other sites More sharing options...
razaro Posted October 6, 2018 Share Posted October 6, 2018 Here is example of how PrestaShop does it. Check in classes/form file CustomerFormatter.php if ($this->ask_for_birthdate) { $format['birthday'] = (new FormField) ->setName('birthday') ->setType('text') ->setLabel( $this->translator->trans( 'Birthdate', [], 'Shop.Forms.Labels' ) ) ->addAvailableValue('placeholder', Tools::getDateFormat()) ->addAvailableValue( 'comment', $this->translator->trans('(E.g.: %date_format%)', array('%date_format%' => Tools::formatDateStr('31 May 1970')), 'Shop.Forms.Help') ) ; } part ->addAvailableValue('placeholder', Tools::getDateFormat()) So you probably need to make similar class with fields you need on your form. Check other classes in that folder. Let us know how it goes. Link to comment Share on other sites More sharing options...
_Sergiy_ Posted April 26, 2021 Share Posted April 26, 2021 Hi! How can I add input mask to birthday form? It must be look like this: <input class="form-control" name="birthday" value="31.05.2001" placeholder="dd.mm.yyyy" data-slots="dmyh" required="" type="text"> Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now