How to add custom css to blank/errors fields in jQuery validation plugin?

ashwintastic

Sorry to ask this type of question but i'm very new to jQuery validation plugin

The plugin is doing all good, but I want that all those input fields having errors/blank should have a red border, how to achieve this through jQuery validation plugin

Md Mahfuzur Rahman

I think you are looking for something like this: See DEMO

The code is here: Example Code

JS:

/* Fire Valaidate */
$(document).ready(function(){
   $("#form").validate({
      rules: {
         name: {
            required: true
               }
         },
         messages: {
            name: "Required Field"
         }
     });
});

CSS:

#form label.error {
    color:red;
}
#form input.error {
    border:1px solid red;
}

HTML:

<form id="form" method="" action="">
    <label for="name">Name</label>
   <input type="text" id="name" name="name">
</form>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to add 'depends:' rule to many fields in jQuery validation plugin?

From Dev

How to validate input fields with a dot in name using the jquery validation plugin?

From Dev

How to validate input fields with a dot in name using the jquery validation plugin?

From Dev

Adding custom validation jQuery Plugin Validation

From Dev

How to add a "depends" condition on valueNotEquals rule in jQuery Validation plugin?

From Dev

Jquery Validation Plugin - Validate Fields Being Added

From Dev

jQuery validation with custom CSS checkbox

From Dev

Django Allauth - How to add custom css class to fields?

From Dev

jQuery Validation Plugin not showing custom messages

From Dev

How add custom swipe navigation for mostslider jQuery plugin?

From Dev

how to add custom error replacment messages in jquery validaiton plugin?

From Dev

jQuery / CSS - Add class on validation

From Dev

In jQuery Validate plugin, how to only validate required fields for being empty, (without syntax validation)?

From Dev

how to use custom method for jQuery validation plugin and how to match string value

From Dev

How can I add the custom text fields under own plugin of WordPress?

From Dev

jQuery Validation Plugin .rules() not working as expected with dynamic added input fields

From Dev

jQuery validation plugin - one error message for all required fields

From Dev

Why add the custom jQuery plugin name to the scope

From Dev

How To Add Validation in Textbox in Jquery

From Dev

How to use ajaxUserCall function in Jquery Validation Plugin

From Dev

How to costum 'notEqual' in plugin jquery validation?

From Dev

How to fix bug errorPlacement in jquery validation plugin

From Dev

how to add jquery to wordpress plugin

From Dev

How to add a jQuery Plugin to Contao

From Dev

jQuery Validation plugin - Custom method comparing two select dropdowns

From Dev

Custom validation for custom fields in React

From Dev

How to send an ajax validation only if jQuery validation plugin succeed?

From Dev

jQuery validation plugin - how to style 1 validation message differently to others

From Dev

How to send an ajax validation only if jQuery validation plugin succeed?

Related Related

  1. 1

    How to add 'depends:' rule to many fields in jQuery validation plugin?

  2. 2

    How to validate input fields with a dot in name using the jquery validation plugin?

  3. 3

    How to validate input fields with a dot in name using the jquery validation plugin?

  4. 4

    Adding custom validation jQuery Plugin Validation

  5. 5

    How to add a "depends" condition on valueNotEquals rule in jQuery Validation plugin?

  6. 6

    Jquery Validation Plugin - Validate Fields Being Added

  7. 7

    jQuery validation with custom CSS checkbox

  8. 8

    Django Allauth - How to add custom css class to fields?

  9. 9

    jQuery Validation Plugin not showing custom messages

  10. 10

    How add custom swipe navigation for mostslider jQuery plugin?

  11. 11

    how to add custom error replacment messages in jquery validaiton plugin?

  12. 12

    jQuery / CSS - Add class on validation

  13. 13

    In jQuery Validate plugin, how to only validate required fields for being empty, (without syntax validation)?

  14. 14

    how to use custom method for jQuery validation plugin and how to match string value

  15. 15

    How can I add the custom text fields under own plugin of WordPress?

  16. 16

    jQuery Validation Plugin .rules() not working as expected with dynamic added input fields

  17. 17

    jQuery validation plugin - one error message for all required fields

  18. 18

    Why add the custom jQuery plugin name to the scope

  19. 19

    How To Add Validation in Textbox in Jquery

  20. 20

    How to use ajaxUserCall function in Jquery Validation Plugin

  21. 21

    How to costum 'notEqual' in plugin jquery validation?

  22. 22

    How to fix bug errorPlacement in jquery validation plugin

  23. 23

    how to add jquery to wordpress plugin

  24. 24

    How to add a jQuery Plugin to Contao

  25. 25

    jQuery Validation plugin - Custom method comparing two select dropdowns

  26. 26

    Custom validation for custom fields in React

  27. 27

    How to send an ajax validation only if jQuery validation plugin succeed?

  28. 28

    jQuery validation plugin - how to style 1 validation message differently to others

  29. 29

    How to send an ajax validation only if jQuery validation plugin succeed?

HotTag

Archive