Follow Along as I Stumble on the Path to Learning RoR

Default Values and Placeholders in Text Fields

You can place text in fields to pre-populate them or to save space by putting the label in the field with simple html.

If you want label a field, you can use the placeholder tag which works in most modern browsers:

If you want to pre-populate a field, with text, you can use the value tag which will put the text, but NOT remove it when the focus is put on the field:

Advertisements

Comments are closed.