SlideShare a Scribd company logo
CORDOVA TRAINING
SESSION: 7 - FORM DATA PROCESSING
INTRODUCTION
 Framework7 comes with few very useful methods to work with forms.
 Form to JSON
 Form from JSON
FORM TO JSON
FORM TO JSON
 We can easily convert all form fields values to JSON object using formToJSON method.
The syntax is:
 formToJSON(form);
FORM TO JSON
<form id="my-form" class="list-block">
…
<div class="item-input">
<input type="text" name="name" placeholder="Your name">
</div>
...
</form>
FORM TO JSON
<div class="content-block">
<a href="#" class="button form-to-json">Get Form Data</a>
</div>
FORM TO JSON
var myApp = new Framework7();
var $$ = Dom7;
$$('.form-to-json').on('click', function(){
var formData = myApp.formToJSON('#my-form');
alert(JSON.stringify(formData));
});
FORM TO JSON
 Note that each input should have "name" attribute, otherwise its value will not be
presented in JSON.
 Checkboxes and "multiple" selects will be presented as Arrays in JSON
FORM FROM JSON
FORM FROM JSON
 Using this App's method we can easily fill up form according to JSON data.
 formFromJSON(form, formData);
FORM FROM JSON
<form id="my-form" class="list-block">
…
<div class="item-input">
<input type="text" name="name" placeholder="Your name">
</div>
...
</form>
FORM FROM JSON
var myApp = new Framework7();
var $$ = Dom7;
$$('.form-from-json').on('click', function() {
var formData = {'name': 'John', 'email': 'john@doe.com', 'gender': 'female', 'switch':
['yes'], 'slider': 10}
myApp.formFromJSON('#my-form', formData);
});
AJAX FORM SUBMIT
AJAX FORM SUBMIT
 Framework7 allows automatically send form data using Ajax. It could be done in two
ways:
 When user submits the form or when the submit event is triggered.
 When user change any form field or when "change" event triggered.
AJAX FORM SUBMIT
 To enable AJAX form submission, we need to add ‘ajax-submit’ class to the form.
<form action="send-here.html" method="GET" class="ajax-submit">
...
</form>
AJAX FORM SUBMIT
 If we need to submit form data when user changes any form fields, we need to use
"ajax-submit-onchange" class.
<form action="send-here.html" method="GET" class="ajax-submit-onchange">
...
</form>
FORM STORAGE
FORM STORAGE
 With form storage, it is easy to store and parse forms data automatically, especially
on Ajax loaded pages.
 When you load this page again Framework7 will parse this data and fill up all form
fields automatically.
 To enable form storage for specific form, all you need is:
 Add "store-data" class to form
 Add "id" attribute to from
 Make sure that all you inputs have "name" attributes.
FORM STORAGE
<form id="my-form" class="list-block store-data">
<ul>
<li>
<div class="item-content"></div>
</li>
</ul>
</div>
FORM STORAGE
 Framework7 just calls formToJSON on any input change and formFromJSON on
'pageInit' event
 All forms data stored in Local Storage and each form has its own Local Storage key
which is named by the following rule: localStorage.f7form-[formID]
 Each such Local Storage key contains stringified JSON with form data.
FORM STORAGE
 Framework7 provides methods to access and work with the form data & local
storage:
 formGetData(formId);
 formDeleteData(formId);
 formStoreData(formId, formJSON);
THANK YOU

More Related Content

Similar to Cordova training - Day 7 - Form data processing

Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + Spring
Bryan Hsueh
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3
masahiroookubo
 
Form demoinplaywithmysql
Form demoinplaywithmysqlForm demoinplaywithmysql
Form demoinplaywithmysql
Knoldus Inc.
 
Rails <form> Chronicle
Rails <form> ChronicleRails <form> Chronicle
Rails <form> Chronicle
Kyosuke MOROHASHI
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSF
Max Katz
 
Web 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHPWeb 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHP
Mohammad Imam Hossain
 
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Faysal Shaarani (MBA)
 
Html forms
Html formsHtml forms
Html forms
nobel mujuji
 
A multi submission importer for easyform
A multi submission importer for easyformA multi submission importer for easyform
A multi submission importer for easyform
Annette Lewis
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with example
Katy Slemon
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
Max Pronko
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
Heather Rock
 
Django Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, TricksDjango Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, Tricks
Shawn Rider
 
Apache Click
Apache ClickApache Click
Apache Click
오석 한
 
AngularJS On-Ramp
AngularJS On-RampAngularJS On-Ramp
AngularJS On-Ramp
Mark Freedman
 

Similar to Cordova training - Day 7 - Form data processing (20)

Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + Spring
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3
 
Jsf
JsfJsf
Jsf
 
Form demoinplaywithmysql
Form demoinplaywithmysqlForm demoinplaywithmysql
Form demoinplaywithmysql
 
Rails <form> Chronicle
Rails <form> ChronicleRails <form> Chronicle
Rails <form> Chronicle
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSF
 
Web 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHPWeb 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHP
 
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
 
Html forms
Html formsHtml forms
Html forms
 
A multi submission importer for easyform
A multi submission importer for easyformA multi submission importer for easyform
A multi submission importer for easyform
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with example
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
 
Django Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, TricksDjango Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, Tricks
 
phptut2
phptut2phptut2
phptut2
 
phptut2
phptut2phptut2
phptut2
 
phptut2
phptut2phptut2
phptut2
 
phptut2
phptut2phptut2
phptut2
 
Apache Click
Apache ClickApache Click
Apache Click
 
AngularJS On-Ramp
AngularJS On-RampAngularJS On-Ramp
AngularJS On-Ramp
 

More from Binu Paul

GIT
GITGIT
Cordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITECordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITE
Binu Paul
 
Cordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API'sCordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API's
Binu Paul
 
Cordova training : Cordova plugins
Cordova training : Cordova pluginsCordova training : Cordova plugins
Cordova training : Cordova plugins
Binu Paul
 
Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7
Binu Paul
 
Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7
Binu Paul
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
Binu Paul
 
Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3
Binu Paul
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
Binu Paul
 
Cordova training : Day 1 : Introduction to Cordova
Cordova training : Day 1 : Introduction to CordovaCordova training : Day 1 : Introduction to Cordova
Cordova training : Day 1 : Introduction to Cordova
Binu Paul
 

More from Binu Paul (11)

GIT
GITGIT
GIT
 
Cordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITECordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITE
 
Cordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API'sCordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API's
 
Cordova training : Cordova plugins
Cordova training : Cordova pluginsCordova training : Cordova plugins
Cordova training : Cordova plugins
 
Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7
 
Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
 
Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
 
Cordova training : Day 1 : Introduction to Cordova
Cordova training : Day 1 : Introduction to CordovaCordova training : Day 1 : Introduction to Cordova
Cordova training : Day 1 : Introduction to Cordova
 

Recently uploaded

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 

Recently uploaded (20)

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

Cordova training - Day 7 - Form data processing

  • 1. CORDOVA TRAINING SESSION: 7 - FORM DATA PROCESSING
  • 2. INTRODUCTION  Framework7 comes with few very useful methods to work with forms.  Form to JSON  Form from JSON
  • 4. FORM TO JSON  We can easily convert all form fields values to JSON object using formToJSON method. The syntax is:  formToJSON(form);
  • 5. FORM TO JSON <form id="my-form" class="list-block"> … <div class="item-input"> <input type="text" name="name" placeholder="Your name"> </div> ... </form>
  • 6. FORM TO JSON <div class="content-block"> <a href="#" class="button form-to-json">Get Form Data</a> </div>
  • 7. FORM TO JSON var myApp = new Framework7(); var $$ = Dom7; $$('.form-to-json').on('click', function(){ var formData = myApp.formToJSON('#my-form'); alert(JSON.stringify(formData)); });
  • 8. FORM TO JSON  Note that each input should have "name" attribute, otherwise its value will not be presented in JSON.  Checkboxes and "multiple" selects will be presented as Arrays in JSON
  • 10. FORM FROM JSON  Using this App's method we can easily fill up form according to JSON data.  formFromJSON(form, formData);
  • 11. FORM FROM JSON <form id="my-form" class="list-block"> … <div class="item-input"> <input type="text" name="name" placeholder="Your name"> </div> ... </form>
  • 12. FORM FROM JSON var myApp = new Framework7(); var $$ = Dom7; $$('.form-from-json').on('click', function() { var formData = {'name': 'John', 'email': 'john@doe.com', 'gender': 'female', 'switch': ['yes'], 'slider': 10} myApp.formFromJSON('#my-form', formData); });
  • 14. AJAX FORM SUBMIT  Framework7 allows automatically send form data using Ajax. It could be done in two ways:  When user submits the form or when the submit event is triggered.  When user change any form field or when "change" event triggered.
  • 15. AJAX FORM SUBMIT  To enable AJAX form submission, we need to add ‘ajax-submit’ class to the form. <form action="send-here.html" method="GET" class="ajax-submit"> ... </form>
  • 16. AJAX FORM SUBMIT  If we need to submit form data when user changes any form fields, we need to use "ajax-submit-onchange" class. <form action="send-here.html" method="GET" class="ajax-submit-onchange"> ... </form>
  • 18. FORM STORAGE  With form storage, it is easy to store and parse forms data automatically, especially on Ajax loaded pages.  When you load this page again Framework7 will parse this data and fill up all form fields automatically.  To enable form storage for specific form, all you need is:  Add "store-data" class to form  Add "id" attribute to from  Make sure that all you inputs have "name" attributes.
  • 19. FORM STORAGE <form id="my-form" class="list-block store-data"> <ul> <li> <div class="item-content"></div> </li> </ul> </div>
  • 20. FORM STORAGE  Framework7 just calls formToJSON on any input change and formFromJSON on 'pageInit' event  All forms data stored in Local Storage and each form has its own Local Storage key which is named by the following rule: localStorage.f7form-[formID]  Each such Local Storage key contains stringified JSON with form data.
  • 21. FORM STORAGE  Framework7 provides methods to access and work with the form data & local storage:  formGetData(formId);  formDeleteData(formId);  formStoreData(formId, formJSON);