0

I want to make some forms which will be saved into a PhoneGap database (that one is declared in index.html). Note that the code I will be linking is not index.html, it is another one. I tried to make the values for these forms to be variables, and then use PhoneGaps javascript to populate the database with these variables.

LINK TO MY CODE

I also want to know this: * If I build this app, will I be able to store this data and be able to restart my phone and it would still be there? Or will the data be lost if I do so? * Do I have to define a database on every HTML site or could I somehow make this data on this current HTML-file to be "INSERT" into the database declared in index.html?

Jack
  • 3,632
  • 7
  • 45
  • 67

1 Answers1

0

Lets try and walk through your questions:

How permanent is data on your phone: How permanent is local storage on Android and iOS?

Edit.html vs index.html

Did you try and just call the database with this piece of code:

db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);

Ofc fill out with your own names that you created your original database with.- Opendatabase either creates the database or opens it.

Community
  • 1
  • 1
Daniel
  • 2,002
  • 5
  • 20
  • 32
  • Thanks for the link. What I meant was, I have created a database on index.html, how do I make edit.html to insert the sql querys from edit.html to index.html database? – Jack Dec 21 '12 at 17:29
  • Im still not sure i understand what you are asking – Daniel Dec 21 '12 at 17:32
  • I have created a database inside a HTML-file called 'index.html', the one I've linked to in this question is a HTML-file called 'edit.html'. In 'edit.html', I want the data from my input forms to be inserted to my database that I've created inside 'index.html'. Is that even possible and if so, how do I make that? – Jack Dec 21 '12 at 17:35
  • I remade my answer, try what i suggested, and let me know if that worked. However, using phonegap its required that you have an index.html, and i would suggest that you stayed in that page for a start, by using some framework like Jquery Mobile. – Daniel Dec 21 '12 at 17:40