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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   13731 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