android prevents buttons in multiple forms from being triggered when an event is submitted

  • 2020-06-15 10:13:07
  • OfStack

Click Photo button, execute the function getPhoto(), and the form executes the function funcSubmit() ng-ES5en automatically. What needs to change to prevent this from happening? It performs only getPhoto() without running ng-ES8en.
Ps. : This code is part 1 of the application android Mobile, developed with the ion framework


<ion-view title="OS">
  <form ng-submit = "funcSubmit()">
    <ion-content class="has-header"> 
      <ion-list >
        <ion-item >
          <button name="fota" class="button button-block button-positive" ng-click="getPhoto()">
            <i class="icon ion-ios7-camera"> Photo</i>           
          </button>
        </ion-item >
      </ion-list >
    </ion-content>
    <div class="bar bar-footer bar-stable">
      <button name="canc" class="button button-light" ui-sref="app.padronis">Cancel</button>
      <button name="subm" class="button button-light" type="submit">Save</button>   
    </div>
  </form>   
</ion-view>

Solution 1:
Usage:


<input type="button" name="fota" ng-click="getPhoto()">


because < button > The commit is automatically called.

This is the end of this article, I hope you enjoy it.


Related articles: