thabet idris

thabet idris

  • NA
  • 35
  • 5.2k

Make a title of the field goes over the field: asp MVC/Razor

Apr 12 2019 5:22 AM
Hi,

I want when I enters information in the field, then the title of the field goes over the field.

Here is my code:
 
so in the field we have the text "FIRSTNAME", my purpose is when i enters information in this field, the text "FIRSTNAME" goes over the field.

And as long as the client has nothing to enter in a field, then the title remains in the field.

I search a lot if there is a trick to add in TextBoxFor to do that but i didn't find!
 
state initial : 
 
state final: 
 


Thanks a lot 
 
  1. @Html.TextBoxFor(model => model.FirstName, new { @placeholder = "FIRSTNAME", @class = "adresse-input"})  

Answers (2)