I want to enhance the login form fields with icons from Font Awesome. For this I need to add some html inside the div of the name and pass fields (to be able to position accurately with css). The html part is for example something like
<i class="icon-lock icon-large"></i>
I tried using #suffix with hook_form_alter, but then the html is added after the div. I also tried with a user-login.tpl.php, but it seems you can only render individual form elements with drupal_render, for example drupal_render($form['name']); But this also outputs the entire div.
What I want to end up with is something like this:
<div class="form-item form-type-password form-item-pass"> <input id="edit-pass" class="form-text required" type="password" maxlength="128" size="60" name="pass" placeholder="Password"> <i class="icon-lock icon-large"></i> </div>
I'm using Drupal 7.