I was wondering if there is a better way of grabbing data from inputs and then posting them. I have this code here which works fine but I just wanna know if there is something better I can do with it to streamline it.
$('#Subscription').submit(function(e){
var url = $(this).attr('action'),
1 = $('input[name=1]').val(),
2 = $('input[name=2]').val(),
3 = $('input[name=3]').val(),
4 = $('input[name=4]').val(),
5 = $('input[name=5]').val(),
6 = $('input[name=6]').val(),
$.post(url, { 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 }, function (data) {
// Do something after post
});
e.preventDefault();
});