javascript - Select box creation in jquery mobile? -
i have created 1 dynamic select box using jquery mobile android application.it created good, when going next list view page , same select box page.the select box disappear.the page displaying blank. reference have attached select box creation code here.anything missed in this. please tell me answer. in advance.
function candidate(id) { window.localstorage.setitem("ojtid",id); $('#cadidateid').find('option').remove(); var content=''; db.transaction(function (tx) { tx.executesql('select * xxx xxid="'+id+'" , status="1"', [], function (tx, result) { if(result.rows.length > 0) { alert("this attended"); } else { tx.executesql('select distinct emp_id,emp_name yyy yyid="'+id+'" group emp_id order emp_name asc', [], function (tx, results) { content=content+"<option value='0'>-- select --</option>"; (var = 0; < results.rows.length; i++) { content=content+'<option value="'+results.rows.item(i).emp_id+'">'+results.rows.item(i).emp_name+'</option>'; } console.log("content:"+content); $("#cadidateid").append(content).trigger('create'); $('#cadidateid').selectmenu().selectmenu('refresh', true); }); } $.mobile.changepage($("#ojtcandidate")); }); }); } html code: <div data-role="page" id="ojtcandidate" data-theme="b"> <div data-role="header" data-theme="b"> <h1>ojt candidate</h1> </div> <div data-role="main" class="ui-content"> <label for="day">select candidate</label> <form> <fieldset class="ui-field-contain"> <select name="cadidateid" id="cadidateid" data-native-menu="false"> </select> </fieldset> </form> <input type="button" value="submit" onclick="session();"> </div> </div>
Comments
Post a Comment