Capitalise strings | XM Community
Skip to main content
I have a field for entering a name. Is there javascript (or other means) of capitalising the first letters of the name?
Hello @duncan_19 ,



Paste the below code to the js(onReady) of the Text entry question type



jQuery("#"+this.questionId+" .InputText").on('blur',function(){



jQuery(this).val(jQuery(this).val().replace(jQuery(this).val()[0],jQuery(this).val()[0].toUpperCase()));



});
Thanks Sashi - this works for the first name but not the last name. Can you extend the code to capitalise all first letters - that would be perfect.

Leave a Reply