Adding placeholder to text area?

Permalink Browser Info Environment
Hi,

I'd like to use a text area for the submitter to add notes, so that the area can expand to show all the entered text. However, since I'm using text fields just above it, and those fields have placeholder text (Your Name, Your Email Address), I'd like to have the subsequent text area also display placeholder text in the same style.

There doesn't seem to be an option for that in the current text field setup. Is that possible to add? If editing the view.css is the right way to do it, could you suggest the location of the change to make, and what css text is appropriate?

Thanks.

Bob

Type: Discussion
Status: New
cmpeters
View Replies:
DeWebmakers replied on at Permalink Reply
DeWebmakers
Hi,

You are right! Completely forgotten!
For now, edit the file /models/elements/types/textarea.php

Find this code:
public $params = array(
 'label' => true,
 'label_hide' => true,
 'default' => array(
  'type' => 'textarea'
 ),
 'required' => true,
 'min_max' => '',
 'tooltip' => true);

change it to this:
public $params = array(
 'label' => true,
 'label_hide' => true,
 'placeholder' => true,
 'default' => array(
  'type' => 'textarea'
 ),
 'required' => true,
 'min_max' => '',
 'tooltip' => true);


This should work!

Best,

Corretje
rijck replied on at Permalink Reply
rijck
I was wanting to achieve the same thing (adding a placeholder In a textarea) and this solution worked perfectly for me.
It also allowed me to make placeholder changes to the address field.
By default the placeholder said "Address_1" and "Address_2" and I changed it to "Address" and "Suburb". More relevant to my needs.
Thanks for the info.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.