Adding HTML to a form field data attribute

Hi there,

I have a form field that displays an error message if the field is left blank.

What I would like to do is to add an icon within the message using HTML. How would I do this?

This is the field:

<input id="form_name" type="text" name="name" class="form-control" placeholder="Please enter your firstname *" required="required" data-error="Firstname is required.">

and this is what I would like to achieve:

<input id="form_name" type="text" name="name" class="form-control" placeholder="Please enter your firstname *" required="required" data-error="<span class='fa fa-check'></span>Firstname is required.">

Any suggestions how I can do this?

Thanks

The message is a browser feature not HTML. :rolleyes:

coothead

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.