0

I'm trying to open a window in a new tab/page after having a user submit info through an AngularJS form. However, Chrome's pop-up blocker is preventing the action.

Here's my $http request part in my app.js

// function to process the form
$scope.processForm = function() {
    $http({
      method  : 'POST',
      url     : 'docusign.php', // PHP script generates URL from form data
      data    : $scope.user  // pass in data as strings

     })
      .success(function(data) {
            window.open(data); // this gets prevented by Chrome's popup blocker
            //The root of the new page I'm trying to open is https://www.docusign.net
            // -- Am I getting a pop-up block because I'm trying to take the user to a 
            // different website?
        });
};
Praveen Reddy
  • 7,295
  • 2
  • 21
  • 43
user3183717
  • 4,427
  • 6
  • 20
  • 42

1 Answers1

-1
// function to process the form
$scope.processForm = function() {
    $http({
      method  : 'POST',
      url     : 'docusign.php', // PHP script generates URL from form data
      data    : $scope.user,  // pass in data as strings
      async   : false

     })
      .success(function(data) {
            window.open(data, '_blank'); // this gets prevented by Chrome's popup blocker
        });
};
Brian McCall
  • 1,831
  • 1
  • 18
  • 33