I have a form in meteor and i am wondering how i would get all the posted data like i would do in php using
$_POST
What would be meteors equivalent of $_POST
I have a form in meteor and i am wondering how i would get all the posted data like i would do in php using
$_POST
What would be meteors equivalent of $_POST
The approach is very different in Meteor (and JavaScript in general). The tutorial explains it here:
Blaze: https://www.meteor.com/tutorials/blaze/forms-and-events
React: https://www.meteor.com/tutorials/react/forms-and-events
Angular: https://www.meteor.com/tutorials/angular/forms-and-events
I serialized array https://api.jquery.com/serializeArray/
‘submit #er’: function(event){
event.preventDefault();
var names = event.target.names.value;
var examname = event.target.examname.value;
var classname = event.target.classname.value;
// var result = event.target.results.value;
var formData = $(’#er’).serializeArray();
console.log(formData);
}
This works well with dynamically created form fields.