anchor.diff:                  $element.val(preferenceString);
               };
   
  -            var handleChanges = function() {
  +            var handleChanges = function () {
                   var val = $element.val();
  +                resetError();
                   // TODO: Check for validity: [a-zA-Z]*
  -                options.onChange(val);
  +                try {
  +                    options.onChange(val);
  +                } catch (err) {
  +                    error()
  +                }
  +            };
  +
  +            var resetError = function () {
  +                $element.removeClass("error");
  +                options.onResetError();
  +            };
  +
  +            var error = function () {
  +                $element.addClass("error");
  +                options.onError();
               };
   
               $element.on("keyup", handleChanges);
               //handleChanges();
  -            return {"showPreference": showPreference};
  +            return {
  +                "showPreference": showPreference,
  +                "init" : handleChanges
  +            };
           };
   
           wigm.error = function ($element) {
               wigm.$submitButton.attr("disabled", "disabled");
           };
   
  -        wigm.resetError = function() {
  +        wigm.resetError = function () {
               wigm.$submitButton.removeAttr("disabled");
           };
   
  
positive.code:                 options.onResetError();
              };
  
              var showPreference = function(preferenceString) {
                  console.log(preferenceString);
  
                  for (var i = 0; i < preferenceString.length; i++) {
                      console.log(preferenceString[i]);
  
                      getFieldByCandidateIdx(charToCandidateIdx(preferenceString[i])).val(i + 1);
                  }
              };
  
  
negative.code:                 });
  
                  var resultString = preferenceArray.join("");
                  options.onChange(resultString);
              };
  
              var error = function ($element) {
                  $element.addClass("error");
                  options.onError($element);
              };
  