Is there an option via JavaScript to say: if the FirstName textfield is not null then update the text so that it is 1st letter being capital and the remaining lower case?
For example somebody types in the FistName textfield: jOHN (accidently).
This is how then the data is stored in SharePoint list, and I would like so that a java script updates the written text into the correct format before it is stored wrongly in the SP list.
I am trying something like this:
NWF$(document).ready(function () {
NWF$("#" + txtFirstName).change(function () {
// get the text value from the FirstNname textfield
var textContent = NWF$('#' + txtFirstName).text();
// check to see if the value is not null
if (textContent.length > 0) {
// format the first letter to UpperCase and the rest to LowerCase
textContent = NWF$("#" + txtFirstName).toUpperCase() + txtFirstName.substr(1).toLowerCase();
this.value = txtFirstName;
}
});
});