当前位置: 移动技术网 > 移动技术>移动开发>Android > android防止提交事件时触发多个表单中的按钮

android防止提交事件时触发多个表单中的按钮

2019年07月24日  | 移动技术网移动技术  | 我要评论

单击拍照 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> 会自动调用提交。

以上所述就是本文的全部内容了,希望大家能够喜欢。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网