0

I’m using a library called floating-tabs.js which is being used to create floating navigational buttons: here’s an example of what the layout looks like

<floating-tabs>
     //this is my button
     <floating-tabs-item icon="ion-android-arrow-dropright-circle" click="goNext(data)"></floating-tabs-item>
</floating-tabs>

<ion-content>
    <form name=“formName” ng-submit="goNext(data)">
        ***form stuff
    </form>
</ion-content>

How can I submit/validate the form without having my button inside the form tags

Thanks guys

1

1 Answer 1

0

here i am using simple change password form.

<form name="changepasswordform"  novalidate>                                   
  <input type="password" placeholder="New Password" class="reset-inputs"  name="newpassword" ng-keyup="compare()"  ng-model="changePassword.newpassword" maxlength="10"  required/> 
  <span style="color:red" ng-show="submitted && changepasswordform.newpassword.$error.required">Required</span>
 </form>
 <button type="button" class="reset-submit" ng-click="changepassword(changepasswordform.$valid,changePassword)">Change Password</button>  

it consist button out side the form

and please use the script in your controller

$scope.submitted = false;
$scope.changepassword = function(formValidStatus, formdata) {
if (!formValidStatus) {
    $scope.submitted = true;
} else {
    $scope.submitted = false;
}
}

in the script i am checking form is valid or not if form is not valid i am showing error messages by using submitted variable from script.

This works for me

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.