<div class="list-group dropdown__list">
<a class="list-group-item myround" href="#">Round 1</a>
<a class="list-group-item myround" href="#">Round 2</a>
<a class="list-group-item myround" href="#">Round 2</a>
</div>
<script>
$( ".myround" ).click(function() {
event.preventDefault();
$.ajax({
type: "GET",
url: "[[~70]]",
data: "&tvname=`raceresultsTV`&tpl=`tableroundsTpl`&docid=`31`&where=`{'round:=':'"+$(this).text()+"'}`",
success: function(html) {
$('#selectedRound').html(html);//returns the html from the getImageList call
}
});
});
</script>
[[!getImageList?]]
This question has been answered by sottwell. See the first response.
<?php
$result=isset($_GET['round']) ? $_GET['round'] : '';
$round=preg_replace('/[^-a-zA-Z0-9_]/', '', $result); //this will take anything and make sure that it only contains letters, numbers, underscores or dashes
if (is_numeric($round)) {
$modx->setPlaceholder('round',intval($round));
}
return;
[[!testsnippet]]
[[!getImageList?
&tvname=`raceresultsTV`
&tpl=`resultsTpl`
&limit=`1`
&docid=`31`
&where=`{"MIGX_id:=":[[+round]]}`
]]
<script>
$( ".myround" ).click(function() {
event.preventDefault();
$.ajax({
type: "GET",
url: "[[~70]]",
data: "&round="+$(this).text(),
success: function(html) {
$('#results-tab').html(html);//returns the html from the getImageList
//console.log(html);
}
});
});
</script>