Added new function to post data onchange when adding new document