function data_change(field)
{
  var check = true;
  var value = field.value; //get characters

	var strValue;

  //check that all characters are digits, ., -, or ""
  for(var i=0;i < field.value.length; ++i)
  {
       var new_key = value.charAt(i); //cycle through characters
       //alert(new_key);

       if(((new_key < "0") || (new_key > "9")) && !(new_key == "") && !(new_key == "."))
       {
		//alert(new_key);

		strValue = field.value;
		//alert(strValue);

		strValue = strValue.replace(new_key,"");
		field.value = strValue;

		check = false;
		break;
       }
  }
  //apply appropriate colour based on value
  if(!check)
  {
	//field.style.backgroundColor = "red";
	//alert("Please enter digits only");
  }
  else
  {
       //field.style.backgroundColor = "white";
  }
}
