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";
}
var_dump($folder) before if(!empty($folder)). What you get?array(2) { [0]=> string(4) "TEst" [1]=> string(0) "" }