post - AngularJS: Submit form the normal way -


i implementing angularjs on existing web application requires common http post without angularjs.

this seems more difficult expected. page url dynamically generated , cannot echoed using php. tried modifying form action using jquery doesn't seem work either.

is impossible submit form normal way? mean normal form:

<!doctype html> <html> <head> </head> <body>     <form method="post">         <input type="text" name="txt">         <input type="submit" name="submit">     </form> </body> </html> 

and same form angularjs:

<!doctype html> <html ng-app> <head>     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> </head> <body>     <form method="post">         <input type="text" name="txt">         <input type="submit" name="submit">     </form> </body> </html> 

the first form performs regular form post, second form doesn't. according http://docs.angularjs.org/api/ng.directive:form design , can provide "action" parameter in form. leaving empty doesn't work , modifying using jquery doesn't seem work either.

i encountered same problem. long angularjs finds empty (or missing) action attribute, prevent submit button/input submitting form.

i managed solve issue adding action="#" attribute.

it's workaround, there ugly # @ end of post url, works. advantage don't need hardcode post url (which dynamically generated) in html code.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -