Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using HTML Placeholder in Laravel 4

{{ Form::text('username', Input::old('username')) }}

This is my code, I want to add Username as placeholder in the text box. I already use bootstrap in the project.

I tried to use the example

{{ Form::text('username', 'Username', Input::old('username')) }}

But it gives a default value which needs to be deleted and then the user has to type his value. I want something like how it shows up on Twitter.com etc. Which gets erased once user types into it.

like image 212
harishannam Avatar asked Jun 30 '13 04:06

harishannam


Video Answer


1 Answers

{{ Form::text('username', Input::old('username'),  array('placeholder'=>'Username')) }}

This works for Laravel 4!!

like image 138
harishannam Avatar answered Sep 28 '22 02:09

harishannam