onsubmit continues after return false

Hi, I have something really weird going on.

In this form header:

<% form_for(:task,:url => tasks_path, :html => { :onsubmit =>
'validate_task();', :id => "new_task" }) do |f| %>

I call "validate_task" to validate some of the form inputs. The
javascript returns false when I don't fill in the task name. Simple,
right. What's weird is that the form submit continues even though the
javascript returns false. Why is this?

You actually have to say return foo - this isn't like ruby, ie your
onsubmit should be 'return validate_task();'