Form validation

Hi All
i am new in axure
my question is …
i wants to make a textfield color red when user entered wrongly
and after correction it should be change to green
can any one suggest me

Place a textfield on the canvas
Place a rectangle widget make it same size as the textfield
Set interaction style of the rectangle widget selected to red
Set interaction style of the rectangle widget default to green
Hide the rectangle widget
Send the rectangle widget to back

Test your textfield by using conditions

So if input is wrong Set rectangle widget to Enable

if not then it takes the default state

thanks jamesorior
for your valuable reply.