Geen extra spaties toestaan bij een invoerveld
<script type="text/javascript">
$(document).ready(function() {
$('.geen-extra-spaties-toestaan').keyup(function() {
var $th = $(this);
$th.val($th.val().replace(/(\s{2,})|[^a-zA-Z']/g, ' '));
$th.val($th.val().replace(/^\s*/, ''));
});
});
</script>