I want to display an error if one of the <input> boxes the user has submitted is empty, but I also want to process the boxes that do not have empty names.
Here is the form: http://jsfiddle.net/Draven/rEPXM/27/
PHP:
if(isset($_POST['addFolder']))
{
foreach($_POST['folder'] as $id => $value)
{
$database->query('INSERT INTO folders (name) VALUES (?)', array($value));
}
$success[] = "Folder(s) added";
}
Try as below
$error contains all indexes which doesn’t have value.