bobber205
bobber205

Reputation: 13372

Want to Warn User of a Error by Making an Input Field Glow

Any way to do this in jQuery?

Doing some change event based validation of elements. When they tab or click out, I'd like to, if there was an error in the validation, to glow the input field a bit rid for a half second to let them know something was wrong.

Any way to do this easily in jQuery? I was thinking along the lines of animate() and a border property but this is a inputfield....

Upvotes: 1

Views: 2313

Answers (2)

mrtsherman
mrtsherman

Reputation: 39882

How about something like this:

http://jsfiddle.net/3UCbw/27/

You can use a wrapper div and apply some css3 styles.

div.highlight {
    -webkit-box-shadow:0 0 15px red; 
    -moz-box-shadow: 0 0 15px red; 
    box-shadow:0 0 15px red; 
}

Upvotes: 1

Brandon
Brandon

Reputation: 70002

If you have the jQuery UI library, you can use the highlight effect.

$("#Field").effect("highlight", {}, 1000);

Upvotes: 2

Related Questions