I want to update a field when a checkbox is checked on VF page
<p>I am customizing Account Edit page. So I created a Edit VF page for Account, on this VF page I am bringing all the contacts which has same owner ID as current Account on Edit VF page. like below</p>

<p><a href="http://i.stack.imgur.com/cOQF8.gif" rel="nofollow">IMAGE LINK</a></p>

<p>So i want to write a javascript function when the checkbox is checked I want to update the Text custom field with contact name and users should be able to choose one contact not more than that.</p>

<p><strong>I don't have much knowledge about javascript please help me with this</strong> </p>