In order to reinforce what you just learned, you will create a new local database, add a table to it, and write and read some data. In order to avoid a long code listing, I removed trivial portions from the code such as HTML tags injecting.
Return to the project you created for the previous example, open the
index.html
file, and add to the markup twoselect
tags in order to let the user pick up a departure country and an arrival one. Make the twoselect
tags required and set up a default option to explain to the user what to do:<select id='departure' required> <option disabled selected value=''>Select a country</option> <!-- All the other options here --> </select> <select id='arrival' required> <option disabled selected value=''>Select a country</option> <!-- All the other options here --> </select>
Add the Contacts API plugin using the command line:
$ cordova plugins add https...