adding p/input switching for all fields of course.
moving num restrict script into directive