Click to See Complete Forum and Search --> : Message border should change
toplisek
01-19-2006, 03:57 AM
I have css for message:
.message { width:auto;
font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;
line-height: 16px; text-decoration: none;
background-color: #FFFFFF;border:1px solid #FF3300; padding:2px }
How to do that it will change border automatic according to error width
Now is 100 % width - always. :rolleyes:
byeee
01-19-2006, 12:17 PM
How to do that it will change border automatic according to error width
What does error width mean?
toplisek
01-19-2006, 02:37 PM
If user puts data and my form on web site shows that there is error in input, it should be error message with border as CSS. Problem is that it is not width as error. It is actually 100 % width of border. Do you know how to fix this? So border should change with text width within message.
byeee
01-20-2006, 02:35 AM
I *think* I understand what you mean, but I'm not too sure about it.
You have a div, and you want it to have a different border color if there was an error.
Just make 2 classes:
.message {}
and .error {}
And set the border color and width for each of them.
In the PHP code of your page, use a simple IF:
echo "<div ";
if ($errors_found) { echo "class=\"error\""; }
else { echo "class = \"message\""; }
echo ">";
Is that what you were looking for?
toplisek
01-20-2006, 04:07 AM
I *think* I understand what you mean, but I'm not too sure about it.
You have a div, and you want it to have a different border color if there was an error.
Just make 2 classes:
.message {}
and .error {}
Message is in my case error. If there is no error it will redirect to another page. So, I do not need two classes. Just error (my name is for this message)
byeee
01-20-2006, 04:12 AM
You could've said that from the beginning...
/* Check for the POSTDATA and do whatever you want with it */
if (isset($_POST['whatever'])) {
/* Process data and set $error variable */
}
if ($error) {
/* Output the error and anything else needed. */
}
else {
header("Location: redirected.php");
}
Is that what you wanted?
toplisek
01-20-2006, 04:30 AM
Again.
I do not need your code as I have already this.
Please give me what to change in CLASS as border is not correct when there is message.
byeee
01-20-2006, 05:01 AM
You don't want any codes... what do you want then?
I just don't understand what you want. Try to correct your posts if you want someone to help you.
toplisek
01-20-2006, 07:01 AM
Please give me what to change in CLASS as border is not correct when there is message.