AngularJS Example - ng-dirty
HTML
<div ng-app="">
<form name="myForm" ng-controller="Ctrl">
userType: <input name="input" ng-model="userType" required>
<span class="error" ng-show="myForm.input.$error.required">Required</span><br>
<tt>userType = {{userType}}</tt><br>
</form>
</div>
CSS
</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
JavaScript
function Ctrl($scope) {
$scope.userType = '';
}