Problem in textfield checker

Hello,

I have on contact form. in this i have lot of textfield. such as name,email,message.

I want to be checked a email textfield. that there is @ sign or not . If there is @ sign then it must be submitted form. or if there is no @ sign then it should be submitted and displayed message.

Please help me

thankx in advance

function checkform() {
	if (yourtextfield_varname.indexOf("@")<0) {
	    trace("not valid");
	}
	else {
		trace ("we have an @");
		//then submit your form here.
		}
}