I want to display the records from db table..I am doing this by the following code
var db = window.openDatabase("DataBase", "3.6.22", "test", 200000);
db.transaction(function(transaction)
{
transaction.executeSql('SELECT * FROM FUND_DET WHERE POLICY_NUMBER="'+polno+'";',[],
function(transaction, result)
{
if (result != null && result.rows != null)
{
//alert("in if");
for (var i = 0; i < result.rows.length; i++)
{
var row = result.rows.item(i);
// document.getElementById('lb'+i).innerHTML=row.FUND_DESC;
var x=row.ALLOC_PERCNT;
// document.getElementById('t'+i).value=xx;
global[i]=row.FUND_DESC;
glob1=row.FUND_DESC;
$("#table").append("<tr><td>"+row.FUND_DESC+"</td><td><input type='text' id='t"+i+"' size='5' /></td><td><input type='text' size='5' /></td></tr>");
var x=$("#t"+i).val(); }
}
},errorHandler);
},errorHandler,nullHandler);
As shown above i want to assign id’s for input tags which are in table tag.So that later i want to use the id’s to set the values or to set the values.But id’s are not assigning to input tags..Please tell me how to assign id’s dynamically
I tried your code and it seems to be assigning the ID attribute correctly.
I’m assuming you want to assign the value of
xto theinputelements. Try this: