I have a html button which I want to generate a report through a controller action, for example,
In my PaymentController.php
public function actionGenerateRI($date){...}
In my admin.php
<button type="button" onclick="generateRI()">Generate</button>
<script>
function generateRI(){
var date = document.getElementById("month").value +"-"+ document.getElementById("year").value;
//what should I write here to call the actionGenerateRI?
}
</script>
How can I use my button to call the controller function AND pass the variable date?
P/S: They are both in the same model, in this case, Payment.