I'm trying to create a page with a few sliders on it. When you change these sliders I would like to modify the data that comes out of my model and update the view.
I know you can solve this by using ajax in regular PHP. But I'm too inexperienced to solve this within the phalcon framework. Phalcon\Forms Doesn't support <input type="range" />. So I added it in my volt file: <input id="number_of_rooms" name="number_of_rooms" type="range" />.
I assume the next step is to create a JS file with a slider event handler which creates a ajax call to my controller. I've created the event handler, but how to approach the ajax call is giving me troubles.
$('#number_of_rooms').on("change mousemove", function() {
// $.ajax({
// method: "POST",
// url: "controllers/IndexController.php",
// data: { value: this.value }
// })
console.log("value: " + this.value);
});
But how to get this data back to my controller to modify my model, I don't know. Help would be greatly appriciated.
Let me know if I am approaching this completely wrong. Thanks!