added javascript to validate form