0

I have a JS array. Each element of that array is a form data in JSON format. I want to loop through this array and submit each form data to the server WITHOUT using AJAX. Can this be done? Any ideas would be a help.

RJA
  • 1

2 Answers2

0

One solution I know is Using Angualar JS service $http

 $http({
          method  : 'POST',
          url     : 'clone.php or servlet or other calls',
          data    : $scope.user, //forms user object
          headers : {'Content-Type': 'application/x-www-form-urlencoded'} 
         })
          .success(function(data) {
                    //do something
           });

References :

  1. Angularjs - simple form submit

  2. http://tutsnare.com/post-form-data-using-angularjs/

Community
  • 1
  • 1
rhitz
  • 1,892
  • 2
  • 21
  • 26
  • Angular js is not being used in the project. Anyways, the above code too will be like an AJAX request which I cant use – RJA Dec 20 '15 at 16:42
0

I don't see if you mentioned where this is executing but if it's not client side (I'm assuming server side since this is tagged CF), you could CFHTTP each item by looping through the array.

Paul Sturm
  • 2,118
  • 1
  • 18
  • 23