If the text box of sina webo is entered blank, when you click on the release button, the red flashing of the text box?

78 5

If the text box of sina webo is entered blank, when you click on the release button, the red flashing of the text box? ( * ^__^ * )

1 Answers

129 1
function normal(id,times)
{
 var obj=$("#"+id);
 obj.css("background-color","#FFF");
 if(times<0)
 {
 return;
 }
 times=times-1;
 setTimeout("error('"+id+"',"+times+")",150);
}
function error(id,times)
{
 var obj=$("#"+id);
 obj.css("background-color","#F6CECE");
 times=times-1;
 setTimeout("normal('"+id+"',"+times+")",150);
}

This allows you to use the following code to display the red background flicker when the component content doesn't conform to the rule.

error("weibo-text-area",3);
...