title: How To Change Text For Selected Fields To Uppercase Using KnockoutJS?
body: <p>My application owners want select text fields to be uppercase as if the caps lock is on. I am using a KnockoutJS viewmodel with observables for these fields. Is there a way I can in effect convert any user entered text to upper case?</p>
  
  <p>I put a <code>input</code> event on the controls I wanted to change but found that although it works, the observables are not updated.</p>
  
  <pre><code>&lt;input type="text" maxlength="80" data-bind="value: colorName, disable: $parent.isReadOnly, event: { 'input': toUpper }" /&gt;
  
  toUpper: function (d, e) {
      if (e.target) {
          if (e.target.value) {
              e.target.value = e.target.value.toUpperCase();
          }
      }
  }
  </code></pre>
  
  <p>I have also been thinking of putting a <code>ucase</code> CSS class on the controls I want to be upper case and then either on the client or server, saving those fields in upper case.</p>
  
  <pre><code>.ucase {
      text-transform: uppercase;
  }
  </code></pre>