I'm trying to wrap $errors in DIV, but even though error messages are not displayed it still displays the Div block.
How can I program it that it would display the div only when the error is displayed?
This is the our output:
<?PHP
echo "<div class='error-message'>";
echo $errors;
echo "</div>";
?>
I guess I can apply the div to each individual $error but when it displays all error messages, it will display them in the individual blocks. I would like them to be inclosed in one div block
if ($action == "update")
{
if (empty($firstName) )
{
$errors .= "» First Name can not be empty";
}
if (empty($lastName))
{
$errors .= "<br/>» Last Name can not be empty";
}
if (empty($emailAddress))
{
$errors .= "» Email Address can not be empty";
}
if (empty($coName))
{
$errors .= "» Company Name can not be empty";
}
if (empty($phoneOffice))
{
$errors .= "<div class='error-message'>» Office Phone can not be empty</div>";
}
if ($errors == "")
{