Using this simple code when you fill #input1 field, the #input2 input gets autofilled with same value:
$("#input1").keyup(function(){
$("#input2").val(this.value);
});
So e.g. if you type in 'Foo Bar' into #input1, it also gets filled as 'Foo Bar' in #input2.
But how do I autofill it into #input2 and at same time e.g. convert to all lower case or all uppercase and with no spaces? So e.g. if #input1 contains 'Foo Bar' then #input2 autofills with 'FOOBAR' or 'foobar'?