I just want to upload particular selected value (checked) in listview on server. There are any values in list with checkbox so I want to select few of them and wants to upload to server. //below code using to set chekcbox on listview
var ajax = {
parseJSON:function(result){
movieInfo.result = result.entries;
$.each(result.entries, function(i, row) {
//console.log(JSON.stringify(row));
$('#movie-list').append('<li>'+'<h3>' +'Store Name : '+ row.STORE_NAME + '</h3><p9>' +'Store Id : '+ row.STORE_ID + '</p9> <p2><br>Store Visit Date : '+ row.STORE_VISIT_DATE + '</p2><p2><br>Comment: '+ row.COMMENTS + '</p2><p>' +'Store Issue : '+ row.ISSUE + '</p><p>'+'User : '+ row.USER_NAME + '</li>');
});
$('#movie-list').listview('refresh');
}
}
/// below script i use to upload data to server // So I just want to get selected valu from ui and uplaod
$(document).ready(function () {
$("#uploadbutton").click(function () {
var S_NO = $("#crm_serialnumber").val();
var USER_NAME = localStorage.getItem("PMUsername");
$.ajax({
type: "POST",
url: "https://c.jsp",
/* url: "https://d="+filename + "&store_name=" + filename2+ "&ph_no="+filename3,*/
data: {
"S_NO" : S_NO,
"USER_NAME" : USER_NAME
},
/*
data: "store_id ="+ filename + "&store_name =" +filename2 + "&ph_no =" + filename3 ,
*/
success: function (msg,String,jqXHR) {
window.location='home.html';
$("#result").html(msg,String,jqXHR)
alert("Data Uploaded: ");
}
});
});
});
//Please help me to solve this problem as I am learning . Thanks
First of all, when you populate your list, i believe you should assign an identifier to your list items, so you can get it later, when you need to post the selection back.
To do that, you can simply set your own custom data-attribute to each list item, the same way you are assigning the text and captions to your paragraphs and headings.
After that, you can filter the checked checkboxes and retrieve the list item which are belonging to: