How can I change the field border colour to red if required and not entered?

  • Profile Image
    teambasekit
    Asked on November 13, 2012 at 04:55 AM

    Hi,

     

    i'd like to change the border colour of a field to red if not entered correctly.

     

    i got it working so its green on focus but would like required fields left empty to turn red once submit is hit.

     

    Thanks

  • Profile Image
    idarktech
    Answered on November 13, 2012 at 05:11 AM

    Hi,

    Append the following CSS codes to your existing CSS codes.

    .form-validation-error {

    border: 1px solid red !important;

    -moz-box-shadow: 0 0 2px red !important;

    -webkit-box-shadow: 0 0 2px red !important;

    box-shadow: 0 0 2px red !important;

    }

    Also, please remove the !important on the .form-textbox border-color on your existing codes to make the entire border color red when required fields left empty.

    Just let us if you need anything else. Thanks!

  • Profile Image
    idarktech
    Answered on November 13, 2012 at 05:13 AM

    This should be the result:

  • Profile Image
    basekit
    Answered on November 13, 2012 at 07:15 AM

    This worked perfectly

     

    Thank you very much :)