The
button calls the function, and the div is used to receive the view content obtained by the function and display it.
Add the following JavaScript function to the jsheader of the form:
function GetViewContent(){
var url = server path/database name/view name?readviewentries"
$.get(url,function(data){
var list = "";
list = "
" if($(data).find("viewentry").size == 0){ } else { $(data).find("viewentry").each(function (){ if($(this).attr("position") < 11) { $(this).find("entrydata").each(function(){ if ( $(this).attr("name")=="name") list ="" $(this).text() " | " $(this).next().text() " | " $(this).next().next().text() " | }) } }) } list = " |
"
$("#ViewContent").html(list);
});
}
Note: The prerequisite for this code to run successfully is that you remember to call jQuery in the form .js files.