Thanks for the reply Sander. (Pls ignore previous post)
I have changed my experiment to use directives. but still form auto submit not working. html ------------ <form method="post" action="https://otherdomain.com/processRequest" name="f1" class="auto-submit" ng-controller="iController"> <table border="1"> <tbody> <input type="hidden" name="ORDER_ID" value="645783663"> <input type="hidden" name="CUST_ID" value="makeb42499"> </tbody> </table> </form> directive: --------------- angular.module('formtest').directive('autoSubmit', ['$timeout', function($timeout) { return { restrict: 'C', link: function(scope, elem, attrs) { $timeout(function() { elem.find('form').submit(); }); } }; } ]); but when i add <input type="submit"> in html, on click of submit button, cross domain form post working. Please let me know how i can do this auto form submit. Thanks in Advance. On Thursday, March 3, 2016 at 1:29:21 AM UTC+5:30, Sadha Sivam wrote: > > Thanks for the reply Sander. > > I have changed my experiment to use directives. but still not working. > > html > ------------ > > <form method="post" action="https://otherdomain.com/processRequest" > name="f1" class="auto-submit" ng-controller="iController"> > <table border="1"> > <tbody> > <input type="hidden" name="ORDER_ID" value="645783663"> > <input type="hidden" name="CUST_ID" value="makeb42499"> > > </tbody> > </table> > </form> > > directive: > --------------- > angular.module('formtest').directive('autoSubmit', ['$timeout', > function($timeout) { > return { > restrict: 'C', > link: function(scope, elem, attrs) { > $timeout(function() { > elem.find('form').submit(); > }); > } > }; > } > ]); > > On Wednesday, March 2, 2016 at 11:04:08 AM UTC+5:30, Sander Elias wrote: >> >> Hi Sadha, >> >> If you want to use form's in this way, don't load angular. If you do this >> inside angular, the form directive >> <https://docs.angularjs.org/api/ng/directive/form> will prevent this >> form from being submitted. >> What you should do is study angular, and how to handle forms with angular. >> >> Regards >> Sander >> > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
