 <p>I haven't tested the code yet but this will help you to get your output</p> <pre><code>function editRecord(id) { db.transaction(function(tx) { tx.executeSql('SELECT * FROM tableOne WHERE id=?', [id], function(tx,results){ for (var i=0; i &lt; results.rows.length; i++){ row = results.rows.item(i); editRecords2(row.name,row.total); } }); }); } function editRecords2(name,total) { f = $('#edit'); f.html(""); f.html(f.html() + ' &lt;form method="get" id="edit_form"&gt;&lt;div&gt;&lt;input type="name" id="editname" value="' + name+'" size="30"/&gt;&lt;input type="number" current id="editamount" value="' + total+'" name="amount" size="15" /&gt;&lt;input type="submit" value="Save" /&gt;&lt;/div&gt;&lt;/form&gt; '); } </code></pre> <p>if any problem occure contact me.</p>