How to export webform data in mysql table?

153 views Asked by At

Suppose I got a webform with some fields like "Name, Surname, Address, Phone, Email, Preference, Hobby". What I need now is when a user is filling the form, Suppose he fills the Name field, the data is stored in the sql table, same goes for surname, once surname field is filled now Name and Surname will be saved in the table. The save must be done on the lost focus event of each field. The user can abandon the form filling anytime, even if the form is not completely filled.

The form by default has the status “Abandoned” which is stored in a hidden field, but once all fields in the form have been completely filled, this status should change to “Processed”.

Can anyone please suggest or get me an example of how this can be done?

1

There are 1 answers

1
Paras Pitroda On

You can implement this logic:

  • Add additional field in database for session ID
  • On lost focus, call ajax to update DB's field and you can check record with session ID field.
  • you can also check using PHP for all fields' value to identify record status instead of javascript update in hidden field