Title: Onblur function
Last modified: January 30, 2017

---

# Onblur function

 *  [saityalex](https://wordpress.org/support/users/saityalex/)
 * (@saityalex)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/onblur-function-2/)
 * Hello and thank you so much for the plugin.
 * I need some help with adding function onblur.
 * I have shortcode in my CF7
    [text your-name id:your-name] that displays a name
   of a user.
 * The name must be Capitalized so I use a function
 *     ```
       <script type=”text/javascript”>
       function upperCaseFirstLetters(ABC123) {
       var myTextObject = document.getElementById(ABC123);
       myTextObject.value = myTextObject.value.replace(/\W\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
       }
       </script>
       ```
   
 * Last, it should be added in <input> tag
 * `<input type=”text” name=”your-name” value=”” size=”40″ class=”” id=”your-name”
   onblur=”upperCaseFirstLetters(this.id)”>`
 * Help me to add this line: onblur=”upperCaseFirstLetters(this.id)” – for the input.
   
   I would like to make it via php or to hook this function to id=”your-name”
    -  This topic was modified 9 years, 4 months ago by [saityalex](https://wordpress.org/support/users/saityalex/).

The topic ‘Onblur function’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [onblur](https://wordpress.org/support/topic-tag/onblur/)

 * 0 replies
 * 1 participant
 * Last reply from: [saityalex](https://wordpress.org/support/users/saityalex/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/onblur-function-2/)
 * Status: not resolved