Knockout JS - auto focus a field?
Hey everyone, I'm writing a small chat client/server with knockout js and nodejs, everything is good, except for the fact, that after I send a message, i lose focus on the message field, and users have to reclick it everytime they want to type (very annoying), do you guys know what I can do? Here is the template

        <script type="text/html" id="chatRoom">
    <div id="chatContainer" class="chatContainer">
    	<div class="chatFrom">
    		<i id="chatClose" class="chatSprite chatClose" data-bind='click: function() { server.removeChat(this) }'></i>
    	</div>
    	<div class="chatMessages">
    		<ul id="chatHolder">
    		{{each messages()}}
    			<li><div class="chatFromText">From: ${ from }</div>
    			<div class="chatTime">${ time }</div><div class="chatMsg">${ text }</div></li>
    		{{/each}}
    		</ul>
    	</div>
    	<div class="chatControls">
    	<form data-bind="submit: function() { send($('#'+channel).val()); $('#'+channel).focus(); }">
    		<input type="text" id="${ channel }" name="message" class="chatText" style="color: #999;" value="Message Here" data-bind='click: function() {
    			$("#"+channel).val("").css("color", "#000");
    		}'  />
    		<i class="chatSprite chatSend" data-bind="click: function() { $('.chatSend').parent().submit() }"></i>
    	</form>
    	</div>
    </div>
    </script>

As you can see I have tried every possible way of focusing the field, but none seem to work. Any suggestions?
Knockout JS - auto focus a field?
===

Hey everyone, I'm writing a small chat client/server with knockout js and nodejs, everything is good, except for the fact, that after I send a message, i lose focus on the message field, and users have to reclick it everytime they want to type (very annoying), do you guys know what I can do? Here is the template

        <script type="text/html" id="chatRoom">
    <div id="chatContainer" class="chatContainer">
    	<div class="chatFrom">
    		<i id="chatClose" class="chatSprite chatClose" data-bind='click: function() { server.removeChat(this) }'></i>
    	</div>
    	<div class="chatMessages">
    		<ul id="chatHolder">
    		{{each messages()}}
    			<li><div class="chatFromText">From: ${ from }</div>
    			<div class="chatTime">${ time }</div><div class="chatMsg">${ text }</div></li>
    		{{/each}}
    		</ul>
    	</div>
    	<div class="chatControls">
    	<form data-bind="submit: function() { send($('#'+channel).val()); $('#'+channel).focus(); }">
    		<input type="text" id="${ channel }" name="message" class="chatText" style="color: #999;" value="Message Here" data-bind='click: function() {
    			$("#"+channel).val("").css("color", "#000");
    		}'  />
    		<i class="chatSprite chatSend" data-bind="click: function() { $('.chatSend').parent().submit() }"></i>
    	</form>
    	</div>
    </div>
    </script>

As you can see I have tried every possible way of focusing the field, but none seem to work. Any suggestions?