Jump to content

Javascript SQLite HTML5

- - - - -

  • Please log in to reply
1 reply to this topic

#1
markeh

markeh

    Newbie

  • Members
  • Pip
  • 1 posts
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)

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
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');






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users