[Skip to main content](#vessel-content)

#   placeholder dans les input en boucle

##

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2705
- Thank you received: 74
-
-

12 years 8 months ago [\#149602](#149602) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149602 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")* was created by *[erickb](/forum/user/4069-erickb "View erickb's Profile")*

-- HikaShop version -- : 230

je veux mettre un placeholder dans les input de type text et texarea

à quelle endroit je met ca avec la valeur du label ? Code:

$this-&gt;fieldsClass-&gt;display( $oneExtraField, @$this-&gt;$type-&gt;$fieldName, 'data['.$type.']['.$fieldName.']', false, ' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"', false, $this-&gt;extraFields[$type], $this-&gt;$type );

merci

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 8 months ago [\#149652](#149652) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149652 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")*

Bonjour,

Il faut faire une modification tel que: Code:

&lt;div id="hikashop_product_custom_item_info" class="hikashop_product_custom_item_info"&gt; &lt;table width="100%"&gt; &lt;?php foreach ($this-&gt;itemFields as $fieldName =&gt; $oneExtraField) { $placeHolder = ''; if($oneExtraField-&gt;field_type == 'text' &#124;&#124; $oneExtraField-&gt;field_type == 'textarea') $placeHolder = 'placeholder="default value"'; $itemData = JRequest :: getString('item_data_' . $fieldName, $this-&gt;element-&gt; $fieldName); ?&gt; &lt;tr id="hikashop_item_&lt;?php echo $oneExtraField-&gt;field_namekey; ?&gt;" class="hikashop_item_&lt;?php echo $oneExtraField-&gt;field_namekey;?&gt;_line"&gt; &lt;td class="key"&gt; &lt;span id="hikashop_product_custom_item_name_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_name"&gt; &lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt; &lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;span id="hikashop_product_custom_item_value_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_value"&gt;&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick'; $oneExtraField-&gt;product_id = $this-&gt;element-&gt;product_id; echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$itemData,'data[item]['.$oneExtraField-&gt;field_namekey.']',false,' '.$placeHolder.' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'item\',0);"'); ?&gt;&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/table&gt; &lt;/div&gt;

The following user(s) said Thank You: [erickb](/forum/user/4069-erickb "View erickb's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2705
- Thank you received: 74
-
-

12 years 8 months ago [\#149653](#149653) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149653 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")*

je vais regarder tout ça

merci

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2705
- Thank you received: 74
-
-

12 years 8 months ago -  12 years 8 months ago [\#149667](#149667) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149667 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")*

comment ajoutez vous une class aux input ?

je veux ajouter la class required
Code:

$requis = ''; $required = $oneExtraField-&gt;field_required; if($required == 1){ $requis = ' required'; } echo $this-&gt;fieldsClass-&gt;display( $oneExtraField, $this-&gt;$type-&gt;$fieldName, 'data['.$type.']['.$fieldName.']', false,' '.$placeHolder. ''.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"', false, $this-&gt;extraFields[$type], $this-&gt;$type );

et comment supprimer dans la boucle les &lt;span class="hikashop_field_required"&gt;*&lt;/span&gt;

merci

Last edit: 12 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 8 months ago [\#149672](#149672) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149672 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")*

Cela fonctionne, testé en local. Editez vous bien la vue "product / show_block_custom_item" ? Code:

&lt;div id="hikashop_product_custom_item_info" class="hikashop_product_custom_item_info"&gt; &lt;table width="100%"&gt; &lt;?php foreach ($this-&gt;itemFields as $fieldName =&gt; $oneExtraField) { $placeHolder = ''; if($oneExtraField-&gt;field_type == 'text' &#124;&#124; $oneExtraField-&gt;field_type == 'textarea') $placeHolder = 'placeholder="'.$oneExtraField-&gt;field_realname.'"'; $itemData = JRequest :: getString('item_data_' . $fieldName, $this-&gt;element-&gt; $fieldName); ?&gt; &lt;tr id="hikashop_item_&lt;?php echo $oneExtraField-&gt;field_namekey; ?&gt;" class="hikashop_item_&lt;?php echo $oneExtraField-&gt;field_namekey;?&gt;_line"&gt; &lt;td class="key"&gt; &lt;span id="hikashop_product_custom_item_name_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_name"&gt; &lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt; &lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;span id="hikashop_product_custom_item_value_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_value"&gt;&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick'; $oneExtraField-&gt;product_id = $this-&gt;element-&gt;product_id; echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$itemData,'data[item]['.$oneExtraField-&gt;field_namekey.']',false,' '.$placeHolder.' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'item\',0);"'); ?&gt;&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/table&gt; &lt;/div&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2705
- Thank you received: 74
-
-

12 years 8 months ago -  12 years 8 months ago [\#149749](#149749) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149749 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")*

oui ca marche mais ma deuxième question :
comment virer ce span avec * (voir ma question ci dessus)
et ajouter un class="required" à la place ?

tel quel c'est très dur de garder un code souple et coherent , tout est génère en amont et le html + css est dur ou impossible à changer

merci

Last edit: 12 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 8 months ago [\#149821](#149821) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149821 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")*

Il n'y a jamais rien d'impossible à changer en programmation. Ca peut en effet être compliqué dans certains cas. Mais ici, rien de très compliqué.
Vous pourriez faire par exemple comme cela: Code:

echo sre_replace('&lt;span class="hikashop_field_required"&gt;*&lt;/span&gt;','',$this-&gt;fieldsClass-&gt;display($oneExtraField,$itemData,'data[item]['.$oneExtraField-&gt;field_namekey.']',false,' class="required" '.$placeHolder.' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'item\',0);"'));

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2705
- Thank you received: 74
-
-

12 years 8 months ago [\#149847](#149847) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[placeholder dans les input en boucle](/forum/5-support-en-francais-french-support-/866921-placeholder-dans-les-input-en-boucle#149847 "-- HikaShop version -- : 230  je veux mettre un placeholder dans les input de type text et texarea  à quelle endroit je met ca avec la valeur du label ?  merci")*

Je peux bien sur tout re-ecrire mais je parlais de l'insertion dans votre boucle

merci pour l'info

sinon dans une version future un placeholder en natif yes/no serait vraiment un plus pour les petits écran et versions mobiles

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODY2OTIxLXBsYWNlaG9sZGVyLWRhbnMtbGVzLWlucHV0LWVuLWJvdWNsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.062 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
