javascript - Input box getting thicker after a CSS background-color modification -
this question has answer here:
i have form validated through javascript script. 1 of function of script highlight input fields have been modified original values contained.
it works, when 1 of input field highlighted, become thicker when normally.
the js script add class input box:
function evidenzia_cambiamenti(id,testo) { if (typeof(testo) === 'undefined') testo = ''; if ((document.getelementbyid(id).value != testo)) { $('#'+id).addclass('campo_modificato'); $('#'+id).removeclass("errore_campo"); $('#'+id).removeclass("campo_obbligatorio"); } else if (document.getelementbyid(id).value == testo) { $('#'+id).removeclass('campo_modificato'); } }
while css class modifies background color:
.campo_modificato { background-color: #ffffcc; }
though none of actions remove default property of input box, can't understand difference between 2 views:
- http://i57.tinypic.com/w8qiia.png -> not-highlighted field
- http://i58.tinypic.com/21n1niu.png -> highlighted field
thank in advance.
apply css: given class applied input
input.campo_modificato:focus { border-style: solid; }
Comments
Post a Comment