Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[solved] Add placeholder text into search box


Go to End


15 Posts   10650 Views

Avatar
mierla

Community Member, 16 Posts

3 October 2013 at 2:27am

@mdowton (or anyone else) - in 3*, any idea how you'd go about it with the

TextField::create("Address", "Street Address")

style construction?

Avatar
martimiz

Forum Moderator, 1391 Posts

3 October 2013 at 4:14am

Edited: 03/10/2013 4:14am

TextField::create("Address", "Street Address")
	->setAttribute('placeholder', 'Enter your address')

Avatar
mierla

Community Member, 16 Posts

3 October 2013 at 4:39am

Thanks martimiz - that worked perfectly!

Avatar
Bennett

Community Member, 2 Posts

25 February 2014 at 11:51am

Is it possible to set the placeholder text in the template rather than in the PHP code?

Avatar
novaweb

Community Member, 116 Posts

25 February 2014 at 11:55am

There is probably a way, but why would you need to do this? I am sure the php option is the conventional solution.

Best,

NovaWeb

Avatar
Kzqai

Community Member, 1 Post

18 April 2014 at 3:32am

Hey @mdowtown That worked for adding placeholders on the admin side as well, thanks much!

Avatar
kevinstripe

Community Member, 10 Posts

29 May 2014 at 5:02pm

Edited: 29/05/2014 8:05pm

I agree with corry . it can also be enabled like his site.

Go to Top