Question to Save or Discard after Navigating Out

I have 1 form (split into 2 web screen) for people to fill out

To make things simple the form has a top navigation bar within the content placeholder

top navigation bar contains Page 1 | Page 2 |

Page 1 has fields of First Name, Last Name, Age
Page 2 has fields of Student ID, Student Grade, Student Avg Grade

Above fields are from one single entity called StudentDB which also includes an Active column as well

Prior entering to the form (always enter from Page 1 Webscreen)

If they click on create application (meaning starting a new form) then it create a new record with the Id autoincrement, also Active field were set as 1 (true) while leaving all other fields empty.

So now they are on the Page 1 webscreen filling out the form. When they click Next or Using the top navigation bar and click on Page 2, it saves whatever you have entered before going Page 2

Let say someone is editing a form previously entered. Page 1 received an input parameter of a Student Report ID. Page 1 will first check if input parameter is NULL or not, if NULL then it must be creating a new report that i mention above, otherwise it will get previous entered data.

My question is there will be at times where someone will click on create report and they might navigate out with no intention of filling the application out rather just take a look whats on there.

How can prevent this with the mechnism like people can have the option to Save or Discard(delete the record which was created) the form.

Pretty much if nothing were filled, it will ask if you want to discard this or not... but checking if fields (textboxes etc..) are empty is a hassle as my real form consist of more than 20 questions each Page with Page 1 to 5

Also would like to keep my logic in place (Page 1 checks if Input Parameter NULL or not, if NULL create new row otherwise Get) as this is already put in production


You can save into a Record instead of writing directly to Table.
When the person is leaving and you ask if it is to save or discard, you can call a Create action or just forget it ever existed.

The only scenario where an id would be required before having data, is if you're simultaneously creating references in other entities. Although another auxiliary Records (or RecordLists) would solve even that case, the joint save action would be less plain.