0

I have a validation and depending on if its correct or wrong i want it to animate the textboxes background-color in different colors: Red if its wrong and green if its correct input. I have tried all different combinations but i just cant get it to work.

$("#PersonId").animate({background: "#ff2cf0"});

$( "#PersonId" ).animate({
      backgroundColor: "#aa0000",
    }, 1000 );

etc etc.. What am i doing wrong? I have implemented the JQuery UI file to my .NET project so i don't think it is anything wrong there.

Daniel Gustafsson
  • 1,725
  • 7
  • 37
  • 78

1 Answers1

0

You will need to include the jQuery color animations plugin.

$( "#PersonId" ).animate({
  backgroundColor: "#aa0000",
}, 'fast');
Prat
  • 495
  • 7
  • 19
  • How do i do that? Ive created a .js file with the code in and ive put it in my content/js folder in my mvc4 project. I have linked it in my layout like this: is there anything else i need to do? – Daniel Gustafsson Sep 11 '13 at 09:37
  • download the plugin from the site, you need jquery ui also I believe. make sure to include it AFTER you include jquery otherwise the plugin won't get recognized – Prat Sep 11 '13 at 11:25