/    Sign up×
Community /Pin to ProfileBookmark

CSS / PHP – reporting errors thing…

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>’;
}
[/code]

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>
[/code]

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!!!

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@invisionauthorOct 29.2007 — ^^


[B]Please ignore the above post, I have managed to solve it[/B]

Thanks and sorry again(two in one week!)
×

Success!

Help @invision spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...