refactor send post function to have all code in onSave event;