change input to function-onsubmit, into a json