You can test the field by className in your javascript and give all required fields the same class name.
Something like this
var form = document.getElementById('myform');
for ( var i = 0; i < form.length; i ++ ) {
if ( /required/.test( form[i].className ) {
if ( !form[i].value ) { // might have to tweek this some ...
alert( 'You missed a required field: ' + field.name );
return false; // test failed, abort form submit
}
}
}
// all fields passed the test ...
return true; // or maybe use
form.submit();
What a required field might look like
<input type="text class="required" name="First Name" />
This is off the top of my head, so I don't know it will work "out of the box" but it's the general idea anyway.
Hope this helps