1

Hello: I have some code I am trying to update with some changes. The code has a form wiih input fields and if someone does not complete the fields on the form the code changes things on the form to "alert" them of an error. I have manage to make it so the background color of the fields changes and also I have added a little "red x" symbol to the background on the far right of the form field. The problem is that the CSS for the font size within the fields is written differently and I am not sure how to apply the CSS changes to it because of that. Here is my code:

here is the "starting CSS" for the input fields:

input, .Select span, .RFID_Modal, select#State {
padding: 0 10px;
width: 100%;
height: 40px;
line-height: 40px;
background-color: #aedaf3;
border: 1px solid #fff;
font-size: 16px;
color: #000;
font-family: 'FordAntenna Medium';
}

this piece of code basically adds some classes to the input fields if the error condition is true:

if($type != 'hidden')
    $autoForm_display = '<div class="Field '   .$error.'">'.$label.$field.'</div>';
else
    $autoForm_display = $field;

return $autoForm_display;

finally here is the "error CSS" I was able to modify and get working:

.Field.Error input, .Field.Error span {
background: #000000 url(./site/error.png) no-repeat right !important;
background-size: contain;
}

here is the "starting CSS" for the font color on the input forms:

::-webkit-input-placeholder { color: #414042; font-family: 'FordAntenna Medium'; }
::-moz-placeholder { color: #414042; font-family: 'FordAntenna Medium'; } /* firefox 19+ */
:-ms-input-placeholder { color: #414042; font-family: 'FordAntenna Medium'; } /* ie */
input:-moz-placeholder { color: #414042; font-family: 'FordAntenna Medium';    }

I am trying to add the ".Field.Error" class to the those CSS statements for the "color" and I cannot get them to work (not as simple as how I did the CSS to change background color etc above)...

So I am hoping someone can help me to update the CSS for the "color" items as well given how they are written....

thanks!

1 Answer 1

2

Can you use .Field.Error input::-moz-placeholder? This should override the "starting CSS" ::-moz-placeholder when the .Error class is on the surrounding input.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.