c# - Override CSS ValidationMessageFor -


i can't seem manage put new css in validationmessagefor in ajax form...

 @using (ajax.beginform(new ajaxoptions { httpmethod = "post", onsuccess = "success", onfailure = "fail" })) {  <div class="separaror">     <div class="line1">         @html.labelfor(m => m.name)         <br />         @html.textboxfor(m => m.name)              @html.validationmessagefor(m => m.name)      </div>      <div class="linha2">         <br>         <input type="submit" value="save" />         <input type="button" id="btncancel" value="cancel" />     </div> </div> 

}

my css

.field-validation-error { color: #e80c4d; font-weight: bold; }  .field-validation-valid { display: none; }  input.input-validation-error { border: 1px solid #e80c4d; }  input[type="checkbox"].input-validation-error { border: 0 none; }  .validation-summary-errors { color: #e80c4d; font-weight: bold; font-size: 1.1em; }  .validation-summary-valid { display: none; } 

it doesn't override.. why that? appreciated! copied css directly default asp mvc 4 application visual studio, have no idea why doesnt work. application i'm doing not default application mvc 4, there must i'm missing

you need set .input-validation-error validation inputs

this how it

.input-validation-error{ background: pink; border: 1px solid red; } 

if style .field-validation-error change validation error message(s).

.field-validation-error{ color: red; font-weight: bold; } 

hope helps


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -