Collecting data from a input field

I have 3 input fields for collecting data, I would like to collect (attach) this data with timestamp in a json file or in my own (separate) sqlite db.
Does anyone have an idea how this works?