In a recent project I needed to check a radio button based on whether or not a text field was populated.
<script language="javascript" type="text/javascript">
if (document.frmCreateAccount.EMail.value=="")
{
document.frmCreateAccount.OKToEMailYes.checked=true;
}
else if (document.frmCreateAccount.EMail.value!="")
{
}
</script>