I try to stop the refresh page when I click on the selection option, but when I stop refreshing the page, the data cannot receive.
here is the code
echo "<form name='frmtopdevotees' method='post' action='topuser_load.php'>
<h4>select month <select id='seldrp' name='themonth' OnChange ='document.frmtopdevotees.submit()'>
$optionsmonths
</select>
<select name='topdevotees' id='seldrp' OnChange ='document.frmtopdevotees.submit()'>
<option value=10 $M10>Top 10</option>
<option value=20 $M20>Top 20</option>
<option value=50 $M50>Top 50</option>
<option value=100 $M100>Top 100</option>
</select> </h4>
</form>";
?>
<script>
$('frmtopdevotees').submit(function (e) {
e.preventDefault();
return false;
});
$('themonth').onchange(function () {
$.ajax({
var value = $('themonth').val();
type: 'post',
data: {
topdevotees: topdevotees,
themonth: themonth
},
url: "topuser_load.php?topdevotees=" + topdevotees + "&themonth=" + themonth,
success: function (response) {
$('themonth').append(response);
}
});
});
</script>
when I remove Onchange = 'document.frmtopdevotees.submit (), then the page stops to refresh but not change the data.
source
share