adding the value of a Radiobutton and checkbox to javascript database

We have on the first page (index.html) two radio buttons and we need to store the value to a database in javascript (see attached database in word). And on the settings page we have also two radio buttons, the selection made on the index.html page must be put into the settings.html page and read out the selected choice, if the user changes the option (in our case english or dutch) we need to store this value in the database again, this is only possible on the settings.html page (the user can return to the index.html page, this is a one-time-setup page) This is the script of the two radio buttons that are both on the index.html and the settings.html: And we have the same question to take the value of a checkbox, here is the code that we have on our settings page, also for the checkboxes we need to add the value inside the database and also be able to show them again if the user returns to the settings page (so he sees what choices he has made before). This code is only available on the settings.html page. We are a little stuck at the moment with this part so you help is very much appriciated. :-) and here is the database that we are using: //database storge function dbBtn(){ db.transaction(populateDB,errorCB, successCB); $.mobile.changePage("settings_succesfull.html" ); } function loadSettings(){ db.transaction(queryDB, errorCB); } function bdClick(){ $.mobile.changePage("settings.html"); db.transaction(queryDB, errorCB); } function queryDB(tx) { tx.executeSql('SELECT * FROM user', [], querySuccess, errorCB); } function querySuccess(tx, results) { len = results.rows.length; if (len > 0) { for (var i=0;iJust an FYI, I don't think windows phone 7 supports HTML5 databases so watch out if you're planning on deploying this phonegap app to windows phone.

以上就是adding the value of a Radiobutton and checkbox to javascript database的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏