Welcome

首页 / 移动开发 / Android / android防止提交事件时触发多个表单中的按钮

单击拍照 button ,执行该函数 getPhoto() ,窗体执行的函数 funcSubmit() ng-submit 自动。 什么会需要更改,以防止这种情况发生?它执行的功能只有 getPhoto() 而无需运行 ng-submit 的形式。
Ps.: 这段代码是应用程序的一部分 android 移动,用离子框架开发

<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>
解决方法 1:
使用方法:

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

因为 <button> 会自动调用提交。
以上所述就是本文的全部内容了,希望大家能够喜欢。