Added js logic to toggle all related fields