Guest User

Untitled

a guest
Jul 22nd, 2019
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. onKeyUp="this.value = this.value.toUpperCase()"
  2.  
  3. function capitalizeEachWord(str) {
  4. return str.replace(/wS*/g, function(txt) {
  5. return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
  6. });
  7. }
  8.  
  9. function checkUpper()
  10. {
  11. var x = $x("P6_TEXT");
  12. if (x.value.trim().substring(0,1) != x.value.trim().substring(0,1).toUpperCase()) {
  13. alert ('First letter Must be in upper case');
  14. x.value = x.value.trim().substring(0,x.value.trim().length-1).toString();
  15. }
  16. }
  17.  
  18. onKeyUp="checkUpper();"
RAW Paste Data