javascript - When queried from database instead of value [object HTMLInputElement] loaded in phonegap -


i new phonegap. used select query show stored input value. below database table.

function populatedb(tx) { tx.executesql('create table if not exists fueldataengine (price text, ttl text,odo text,date text)');   price=document.getelementbyid('price');  totallitres= document.getelementbyid('ttl');  odometer=document.getelementbyid('odo');  date=document.getelementbyid('date');   tx.executesql('insert fueldataengine (price,ttl,odo,date) values (?,?,?,?)', [price,totallitres,odometer,date],successcb,errorcb); 

i have tabulate query result.in tabulation query result showing [objecthtmlinput element] coming.please

change:

price=document.getelementbyid('price'); totallitres= document.getelementbyid('ttl'); odometer=document.getelementbyid('odo'); date=document.getelementbyid('date'); 

to:

price=document.getelementbyid('price').value; totallitres= document.getelementbyid('ttl').value; odometer=document.getelementbyid('odo').value; date=document.getelementbyid('date').value; 

with out .value saving whole htmlinput element object instead of it's value

note: .value assuming of inputs text fields, if not true can how value of other types of elements textarea , select.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -