Here is the code (which I included in the main page of the form) for the errors function.
function errors($field_name, $error_message)
{
global $errors;
if(!isset($_POST[$field_name]) || ( trim($_POST[$field_name]) == '') )
{
$errors[$field_name] = '<font face="Arial" color="#FF0000" size="+1"> ' . $field_name . '<-' . $error_message . '</font>';
}
}
And the 3 videos I picked on form1 where:
[0] =>UC-GD
[1] =>UR-ED
[2] =>UR-FS
Which I use this data to build an array of radio buttons ($rate) for them to rate the videos on form2.
On form2 the radio buttons are named (dynamically):
Rating[0]
Rating[1]
Rating[2]
So in the end, I need to build the $errors from the loop to look like this...
$rate0 = errors('Rating[0]', 'This is a required field.');
$rate1 = errors('Rating[1]', 'This is a required field.');
$rate2 = errors('Rating[2]', 'This is a required field.');
This is where I am now trying to take the POST data and process it into the errors function and 'add' it to my list of $errors array so if they do not rate each of the videos selected from form1, I can warn them.
My errors function is working flawlessly (thanks to NogDogs here.)
I am just trying to finish off the last of my validation with this (dynamically built list of radio buttons, from the users choices on from 1).
Does that make sense, and did I fill in all the missing blanks?
Thanks for the guidance and help.
Don