Yes, second sample (html) has ie.
class="required" and
minlength="3", both of them are used by jQuery Validation plugin:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Notice that although it's fast and easy to use, it's worth to validate also on server-side - remember that request can be manipulated or client-side JS validator may fail on some weird browser - in such case server-side validation should catch an errors as well and at least display minimal info instead of 'blind' saving incoming data.