0
I’d like to signal when the input
of a form
be wrong.
I’m wearing jQuery. In my head I imagined this:
if ($("#campo1").val() < 0){
var i;
for (i = 0; i < 10; i++) {
$('#campo2').attr('style', 'border-color: red');
sleep(1000);
$('#campo2').attr('style', 'border-color: #cccccc');
sleep(1000);
}
}
But it is not working. Certainly in practice it should not be so.
Wrong? What would be wrong? Empty? Try to be more specific.
– sant0will
Surely lack the width of the edge think the attribute is
border-weigth
.– Vinicius De Jesus
@sant0will This is the driving
if ($("#campo1").val() < 0){
– Tiago
@Viniciusdejesus It turns red, but does not blink, as the original idea. So it means that my code is not the correct way to do this.
– Tiago
Ahhh got it wrong, it wouldn’t be the one second?
– Vinicius De Jesus
maybe you should slow down the time
– Vinicius De Jesus
Interested in a CSS-only answer?
– hugocsl