This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Change Value Default for placeholder
Started 11 years ago by jdevelopia | 13 posts |
-
Hi guys
How I can change the "value" for "placeholder"?
When I put a "Default Value" in one of my field-forms I see this code:
<input id="element_1" class="element text medium" type="text" value="Default Value" name="element_1"> how I can changes this by:
<input id="element_1" class="element text medium" type="text" placeholder="Default Value" name="element_1">Thanks a lot!
Posted 11 years ago # -
You can edit the "includes/view-functions.php" file. There are many places you need to adjust though.
Basically you need to find this code:value="{$element->default_value}"
and change it to become:
placeholder="{$element->default_value}"
MachForm Founder
Posted 11 years ago # -
Great!!! I have it!!! thanks thanks a lot Yuniar!
big hug!!
Posted 11 years ago # -
hi again!
When I put some text in Defalut Value in a Field Type "Paragraph Text" the placeholder doesn´t works.
What I need to change?
Thanks a lot!!!!
Posted 11 years ago # -
I can´t find the function to change the Default Value into the Field Type "Paragraph Text".
Help!! ;)
Thanks a lot!
Posted 11 years ago # -
I think I change the line 258 of view-functions
$element_markup = <<<EOT <li id="li_{$element->id}" {$li_class}> <label class="description" for="element_{$element->id}">{$element->title} {$span_required}</label> <div> <textarea id="element_{$element->id}" name="element_{$element->id}" class="element textarea {$element->size}" rows="8" cols="90" {$input_handler}>{$element->default_value}</textarea> {$range_limit_markup} </div>{$guidelines} {$error_message} </li> EOT; return $element_markup; }
but i can´t do it successfull!
Posted 11 years ago # -
I'm afraid the paragraph field is a bit more complicated and you can't simply change the attribute to "placeholder" without affecting the whole functionality. Sorry. I don't have a workaround for this yet.
MachForm Founder
Posted 11 years ago # -
thanks a lot Yunair, don´t worry I understand perfectly the reason.
Again, thanks a lot.
Posted 11 years ago # -
Has there been any progress with creating a placeholder section so we dont have to change this per machform?
Posted 10 years ago # -
@burkecom - great question - bump.
Also, paragraph replace would be awesome.
You can edit MF3.5
"includes/view-functions.php"
file.line # 144
line # 732
line # 779
line # 960
line # 2727value="{$element->default_value}"
WITH
placeholder="{$element->default_value}"
as Yuniar mentioned above
Posted 10 years ago # -
Just a note for anyone doing this modification, make sure not to replace your field's label completely with placeholders as it might reduce the usability of your form. A good read on this:
http://www.nngroup.com/articles/form-design-placeholders/
MachForm Founder
Posted 10 years ago # -
can we have a new database field to be added to capture the placeholder value and in the code we configure the value as it would be a clean solution for this?
Posted 10 years ago # -
Yes and when using the place holder, the required fields error section removes the placeholder... as i am using hidden field titles the boxes are highlighted and show blank boxes.
any way to have placeholders remain?
Posted 10 years ago #
Reply
You must log in to post.