Javascript help

Hi guys!

I have a form with 1 textbox, a set of radio buttons and a submit button. When the user clicks on submit, and the textbox is empty the user is asked to fill “Nill” if he wishes to leave the box empty. But if he writes anything in the textbox other than “Nill” (or in any case insensitive form) he should be prompted to check at least one of the radio buttons. Any idea how to do this?
I tried testing it with this:
[color=red]<script>[/color]
[color=red]function chk()[/color]
[color=#ff0000]{[/color]
[color=red][/color]
[color=red]var date1 = document.myform.myText.value;[/color]
[color=red]
var expression = /^[ ]?nill[ ]?$/i;[/color]
[color=red][/color]
[color=red]if(!expression.test(date1) && date1 != “”)
{
alert(" Working, now check for radio buttons ")
}[/color]
[color=red]}[/color]
[color=#ff0000]</script>[/color]
[color=#ff0000][/color]
but this itself isn’t working :frowning:

please help!