I have created some dynamic fields and want to make them required.
I am using the following code and it works but I need to create a loop in case there are more than 2 fields

Code:
function validateForm()
{ 
   if( document.myForm.record_0.value == "" )
   {
     alert( "Please select a record series." );
     document.myForm.record_0.focus() ;
     return false;
   }
   if( document.myForm.record_1.value == "" )
   {
     alert( "Please select a record series." );
     document.myForm.record_1.focus() ;
     return false;
   }
   return( true );
}