You probably want to call your checker function on the onkeypressed event instead of the onfocus event.

But none of this is the "wicket way"!
With wicket you can use an AjaxFormComponentUpdatingBehavior("onkeypressed") on the text field which updates your model and rerender the checkbox.

//Swanthe

vishy_sb wrote:
Hi all,
I have a textbox and a checkbox in a form on my web page. I would like to
automatically check the checkbox when the user starts to type something in
the textbox. I believe this can be done by using some javascript. I did some
research over the web and was able to find some code which is shown below.
However I was not able to get it to work.

HTML code:
<input name="containText" TYPE="text" size = "32"
onfocus="checker('contain')" />
<input type = "checkbox" name = "contain" />

Javascript code:
function checker(checkbox) {
var checkBox=document.form.contain; checkBox.checked = true;

}


Any help will be greatly appreciated.

Thanks a lot
Cheers,
vishy



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to