Hello,
I wish to highlight the field with the error within my form. Right now I echo out all the errors in one massive div, which looks a bit ugly considering the form size.
Right now, I’m echoing out errors from my form as so:
[code=php]
if ($message) {
echo “<div class=’alert’>”;
echo “<font color=’red’><b>The following problems occurred:</b><br /><br />n”;
foreach ($message as $key => $value) {
echo “$value <br />n”;
}
echo ‘</font></div>’;
}
and an excerpt from my html
[code=html]
<div class=”required”>
<label for=”company_name”>Company Name:</label>
<input type=”text” name=”company_name” id=”company_name” class=”inputText” size=”10″ maxlength=”60″ value=”<?=$HTTP_POST_VARS[company_name] ?>”/>
</div>
Is there any CSS or PHP I can use which echoes out the error or puts a red border or something around the input field which has the error.
This is a lot to ask I know, but any help or a nod in the right direction is greatly appreciated.
Thanks a million!!!