0

I'm building an HTML form that validates with the jQuery validation plugin.

Minimal Working Example on JSFiddle

I'm now trying to add hints to my input boxes so that it's easier for the user to see what to enter as the table length increases.

Note that the 'Email' field is validated with the validation plugin. The problem is that the validation plugin is validating based upon hint-text.

I don't want to manually write a bunch of filters that compare against the hint text, so I was wondering if there was an alternative means of setting the hint-text than manually setting $(elem).val()?

Fabian Tamp
  • 4,416
  • 2
  • 26
  • 42

1 Answers1

0

You could use "placeholder" instead of "data-hint".

<input type="text" class="email" placeholder="Email" />

http://jsfiddle.net/yc4ZA/

Ben Emmett
  • 450
  • 1
  • 3
  • 9
  • Ah, should've added to my question that I need to support IE9. But, just found this [placeholder support plugin](https://github.com/mathiasbynens/jquery-placeholder) which will work in those situations. Thanks for setting me on the right track there. – Fabian Tamp May 22 '13 at 00:14
  • See-also this question: http://stackoverflow.com/questions/15020826/how-to-support-placeholder-tag-in-ie8-and-9 – Fabian Tamp May 22 '13 at 00:21