i could make the script for you, but then you'd never learn the fun of it for yourself!
check out http://www.wsabstract.com/javatutors/form1.shtml
for a form validating tutorial.
i thinkt he method they use to access the forms is deprecated though...more the concept. i would recommend document.getElementbyId("id").value instead of document.formname.id.value, could someone confirm that?