damianb123
asked on
Help setting textbox border colour on validation failure
Hi,
I am using a PHP page with some validation code as follows:
if (!empty($_POST['street'])) {
$street = $_POST['street'];
} else {
echo '<p class="errorlarger"><stron g>Please enter your street</strong></p>';
}
However rather than displaying a string of text, I want to change the textbox border of the field causing an issue, how would I change this line of PHP to allow for the textbox border to be changed?
echo '<p class="errorlarger"><stron g>Please enter your street</strong></p>';
Thx in advance.
I am using a PHP page with some validation code as follows:
if (!empty($_POST['street']))
$street = $_POST['street'];
} else {
echo '<p class="errorlarger"><stron
}
However rather than displaying a string of text, I want to change the textbox border of the field causing an issue, how would I change this line of PHP to allow for the textbox border to be changed?
echo '<p class="errorlarger"><stron
Thx in advance.
If you make a Google search for CSS Forms Border Color, you will find a lot of good resources. This looked good at first glance:
http://webdesign.about.com/cs/forms/a/aaprettyforms.htm
http://webdesign.about.com/cs/forms/a/aaprettyforms.htm
ASKER
Hi Ray,
thanks for your input, however I really need someone to provide the content to integrate with PHP, I could have looked myself if I had the time, hence the post with 500 points on here.
Sorry.
thanks for your input, however I really need someone to provide the content to integrate with PHP, I could have looked myself if I had the time, hence the post with 500 points on here.
Sorry.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
I've tried to make this work but cannot...... surely you need some form of PHP wrapper here to make the variable appear:
<input style="border-color:$boxer _abc;" name="abc
html will just see this as plain text?
Damian
I've tried to make this work but cannot...... surely you need some form of PHP wrapper here to make the variable appear:
<input style="border-color:$boxer
html will just see this as plain text?
Damian
Please try clicking this link. Experiment with the script. It is on my server and you can see exactly how it works. The source code is posted at ID:35342262.
http://www.laprbass.com/RAY_form_highlight_errors.php
Best regards, ~Ray
http://www.laprbass.com/RAY_form_highlight_errors.php
Best regards, ~Ray
ASKER
Thanks, this worked fine in the end.
Cheers
Cheers
Thanks for the points - it's a great question! ~Ray
http://www.laprbass.com/RAY_form_highlight_errors.php
HGH, ~Ray
Open in new window