<input type="text" name="test" placeholder="Test" onkeyup="this.value=this.value.replace(/\s+/gi,'')"/>
Please note: JavaScript is required to post comments.