Re: Check a checkbox when focus on a textbox

2008-11-21 Thread Swanthe Lindgren
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]



Check a checkbox when focus on a textbox

2008-11-20 Thread vishy_sb

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
-- 
View this message in context: 
http://www.nabble.com/Check-a-checkbox-when-focus-on-a-textbox-tp20603583p20603583.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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