Added a function to retrieve all data from the input fields