SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 53 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top