romman romman - 1 year ago 141
HTML Question

how do i add permanent place holder inside input filed

i need to add

inside input field so i used this method

<input type="text" name="your name" placeholder="&#xe00b; YOUR NAME" style="font-family:Flaticon" class="restrict">

as you see
placeholder="&#xe00b; YOUR NAME"
but my problem is when user types some text place holder disapper so i need font icon to be placed permanent inside input field like

can someone help me

Answer Source

You can't. What do you expect it to look like? placeholder disappears by design.

If you want to prefix an icon in front of your input field, put them together in a container, give this container the needed style and put there your icon and your input-tag. That's the way, how bootstrap your problem solves.

Example of bootstrap.

Shortened example:

<div class="input-group">
  <div class="input-group-addon">$</div>
  <input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount">

Of course, you need CSS.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download