Sign up to Knack for Free - Affiliate Link
In this video, I share a simple yet powerful snippet of code that automatically capitalizes names in your forms. Watch as I demonstrate how to integrate this JavaScript solution into your KTL setup, ensuring that names like "Boris Johnson" are formatted correctly. I also touch upon a previously discussed method to submit forms without refreshing the page. If you find this tutorial useful, don’t forget to give it a thumbs up and subscribe for more tips and tricks!
Add to JavaScript
//Capitalise First Letter of First and Last Name
$(document).on('knack-view-render.any', function (event, view, data) {
// Capitalise First Name
$('input#first').keyup(function () {
this.value = this.value.charAt(0).toUpperCase() + this.value.slice(1);
});
});
$(document).on('knack-view-render.any', function (event, view, data) {
// Capitalise Last Name
$('input#last').keyup(function () {
this.value = this.value.charAt(0).toUpperCase() + this.value.slice(1);
});
});
Komentáře