I am writing a birthday validation form with JavaScript but it doesn't work. Could you please help to find out which part is wrong? How to fix it?

JavaScript

```
function onFormSubmit(form_element) {

    var slashcount = 0;
    if ((form_element.birthday.value =="")||(form_element.birthday.value ==null))
    {
        alert("This field is required. Please enter date mm/dd/yyyy!");
        false;
    }
    for (var i=0; i < birthday.length; i++)
    {
        temp = "" + birthday.substring(i, i+1);
        if (temp == "/")
        {
            slashcount++;
        }
        if (valid.indexOf(temp) == "-1")
        {
            alert("error1.");
            false;
        }
        if (slashcount != 2)
        {
            alert("error2");
            false;
        }
        if((birthday.charAt(2)!= '/')||( birthday.charAt(5) != '/'))
        {
            alert("error3");
            false;
        }
    }
    return true;
}​

```

HTML

```
<form onsubmit="return onFormSubmit(this)">

        Birthday:<input type="text" name="birthday" /><br />
        <input type="submit" value="submit" />
</form>

```