Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Javascript SQLite HTML5

HTML5 HTML html5 sqlite

  • Please log in to reply
1 reply to this topic

#1 markeh

markeh

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 03 March 2011 - 06:07 AM

I'm not sure whether I should post this here or the html or db subforums as I don't know which is more appropriate, but I'm hoping someone can help in here :crying:

I've made a simple page which creates a database, table etc. I can delete and add records from the the page and the rows are displayed inside text boxes.

I just want to be able to edit the contents of the rows via the text boxes and click the save button to update the row, but no matter what I do I can't get it to work.

This code:
tx.executeSql('UPDATE groupOne SET name = 4, amount = 5 WHERE id=?', [id], renderRecords)
works to set the contents of each row to 4 and 5, but how do i substitute the 4 and 5 for the text box values, it seems so simple but its beyond me!!

Hopefully someone can help, I'm properly stuck now. The full code is at Machine totals (Pastebin)
  • 0

#2 wim DC

wim DC

    Roar

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 2681 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Python

Posted 04 March 2011 - 03:27 AM

Like this you mean?
document.getElementById('name').value = '4';
document.getElementById('amount').value = '5';

Edit:
I noticed you got jQuery
$('#name').val('4');
$('#amount').val('5');

  • 0





Also tagged with one or more of these keywords: HTML5, HTML, html5, sqlite

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download