Need Help with a javascript snippet

Basically I need a check box to be checked if there is a value in a text field and unchecked if not. And the check box is readonly. Any ideas, searched around but couldnt find a lil snippet.

:cheers: