Write gravity forms field values to server file before submission

I have a gravity form and I want to write the values of the fields to a server file, before submission, to capture people who don’t finish the form. I know there is a partial entries add on but I wondered whether this would be possible using node js?

I was thinking of an onblur event that writes the field value to a file.

If this is possible, how would I link this to the gravity form itself ? Where do I place the code? Can’t put js in functions.php so maybe use the css class option on the fields ?

Any advice appreciated.