Calling javascript in submit

You should probably call it onsubmit:

<form onsubmit="validate()">