how can i design a form so that the data users enter into it is automatically saved to SharePoint, without clicking Submit,
You may want to reconsider you choice of tool. InfoPath will not be supported for much longer. That was announced years ago. The supported tool for online forms is PowerApps, which is included in most Office 365 and SharePoint online plans. With PowerApps you can run apps offline on mobile devices.