Thursday, December 2, 2010

Convert field to Uppercase automatically

Create a new javascript file /add to existing
function toUpperCase(evt) {
   var _filterField = evt.getCurrentTarget();
   var _value = _filterField.getSubmittedValue();
   _filterField.setValue(_value.toUpperCase());
   }
Add a javascript function to the template page
If not already in the template drop a resource from the operation palette on the page and set it to javascript. Add the source file in the properties window.
Add a client listener to the field you wish to have in uppercase and add the javascript function and use keyUp as the Type

Every time you type a letter it is converted instantly to Uppercase as the keyUp action is completed.

No comments:

Post a Comment