fixed javascript in partial situation(dateField)