diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php
index 4fdf79291bb..69faa334a71 100644
--- a/htdocs/core/class/html.formsetup.class.php
+++ b/htdocs/core/class/html.formsetup.class.php
@@ -449,12 +449,12 @@ class FormSetup
/**
* Create a new item
- * the tagret is useful with hooks : that allow externals modules to add setup items on good place
+ * The tagret is useful with hooks : that allow externals modules to add setup items on good place
*
* @param string $confKey the conf key used in database
* @param string $targetItemKey target item used to place the new item beside
* @param bool $insertAfterTarget insert before or after target item ?
- * @return FormSetupItem the new setup item created
+ * @return FormSetupItem the new setup item created
*/
public function newItem($confKey, $targetItemKey = '', $insertAfterTarget = false)
{
@@ -911,7 +911,7 @@ class FormSetupItem
*/
public function generateInputFieldText()
{
- if (empty($this->fieldAttr)) {
+ if (empty($this->fieldAttr) || empty($this->fieldAttr['class'])) {
$this->fieldAttr['class'] = 'flat '.(empty($this->cssClass) ? 'minwidth200' : $this->cssClass);
}
return 'fieldAttr).' />';
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index 36ff46827d4..d843de8a342 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -102,6 +102,7 @@ $item->cssClass = 'minwidth500';
// Setup conf for selection of a simple string input
$item = $formSetup->newItem('MYMODULE_MYPARAM2');
$item->defaultFieldValue = 'default value';
+$item->fieldAttr['placeholder'] = 'A placehoder here';
// Setup conf for selection of a simple textarea input but we replace the text of field title
$item = $formSetup->newItem('MYMODULE_MYPARAM3');