• 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 7 years, 10 months ago by saityalex.
  • The topic ‘Onblur function’ is closed to new replies.