Toggle show/hide on mask

HTML

<div class="form-group">        
  <label>${Field Name}:</label><br/>       
  <input type='checkbox' class="glyphicon glyphicon-eye-close toggleMask" ng-click="c.toggleMask()" />       
  <input id="steve" role="textbox" ng-attr-type="{{inputType}}" class="form-control" ng-model="c.data.ssn" style="" autocomplete="off"
    class="form-control masked-element ng-valid ng-valid-maxlength ng-not-empty ng-dirty ng-valid-parse ng-touched" /><br/>
</div>

Client Script:

api.controller=function($scope) {
	/* widget controller */
	var c = this;
	$scope.inputType = 'password';

	c.toggleMask = function() {
		if ($scope.inputType == 'password') {
			$scope.inputType = 'text';
		}
		else {
			$scope.inputType = 'password';
		}
      };
};
Maria Gabriela Waechter

She/Her || Senior Outbound Product Manager @ ServiceNow || 2022, 2021 ServiceNow Developer MVP

Maria Gabriela is passionate about making ServiceNow resources and opportunities accessible to everyone regardless of income, identity, nationality, upbringing, or environment. As a proud member of the LGBTQ+ community, a Venezuelan-American immigrant, and a woman with disabilities, Maria Gabriela strives to break boundaries and highlight the contributions of traditionally marginalized groups.

https://mgopw.dev
Next
Next

UIB: UX Page Properties (and other stuff?)