Hi, I got a problem validating a form.

Pretty much I want to make sure someone enters a name. The problem is you can input black spaces into an input and flash thinks that it is a value.

Iv'e been using this code which is kind of ok but the problem with it is that if you accidentaly enter a blank space first then a name it is returned as an error.

on (release) {
if( _root.contact_form.form_name.indexOf("") == 0 || _root.contact_form.form_name.length<2){
_root.contact_form.form_status="Please add your NAME";
}else if(_root.contact_form.form_area_code=="select"){
_root.contact_form.form_status="Please select your AREA CODE";
}else if(isNaN(_root.contact_form.form_phone)||_root.con tact_form.form_phone==null || _root.contact_form.form_phone.length<6){
_root.contact_form.form_status="Please add your PHONE NUMBER";
}else if(_root.contact_form.form_prefered_time=="select" ){
_root.contact_form.form_status="Please select your PREFERRED CALL TIME";
}else{
_root.contact_form.form_status="";
loadVariables("formmail.php",_root.contact_form,"P OST");
this._visible=false;
_root.WindowIN._visible=false;
_root.back_mov._visible=false;
_root.thanks._visible=true;
}
}

Any ideas, it's driving me mad.

Cheers

David