i know while using angular's ng-submit disable default form action , use angular's function problem when used laravel blade templating somehow not disable function... below code, if
{!! form::open(array('class' => 'form-horizontal signup-form', 'ng-submit' => 'updateprofile()')) !!} and when inspect generated code, gives me
<form method="post" action="http://www.example.com:8000/profile/update" accept-charset="utf-8" class="form-horizontal signup-form ng-pristine ng-valid" ng-submit="updateprofile()"><input name="_token" type="hidden" value="8pnebrxkusfguvswfvfamfpullbo6kiet6liec5b"> which when submit button triggered, executes form's action instead of calling angular's giving me methodnotallowedexception. when use manual coding
<form ng-submit="updateprofile()" class="form-horizontal signup-form"> everything works charm. wonder if knows workaround issue can share experience me. know can manual code these section again, want maintain consistency in codes.
i think when submit form generate laravel form builder, calling updateprofile() function , may don't prevent default action of event @ end, because of form has action page submit action. if form has no action there no way submit form manual code, if put action manually coded form same updateprofile() submit form action provided.
to avoid put event.preventdefault(); inside updateprofile() function.
$scope.updateprofile = function(event) { ...... event.preventdefault(); } and pass event function as, updateprofile($event)
{!! form::open(array('class' => 'form-horizontal signup-form', 'ng-submit' => 'updateprofile($event)')) !!}
Comments
Post a Comment