III,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
window.onload = function ()
{
document.querySelector('#fio').oninput = function ()
{
this.value = ((this.value).split(' ').map(function(a, i) {return i > 2? a: a.replace(/([а-яё])([а-яё]+|$)/gi, function (a, b, c) {return b.toUpperCase()+c})}).join(' '))
}
}
</script>
</head>
<body>
<form action="http://">
<input id="fio" name="">
</form>
</body>
</html>