Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8728083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:33:23+00:00 2026-06-13T08:33:23+00:00

how do i find the trigger button in form by ng-submit and get attribut

  • 0

how do i find the trigger button in form by ng-submit
and get attribut in this button

<form ng-submit="submit()" ng-controller="Ctrl">
  <input type="submit" att1="A" att2="B" value="Edit" />
  <input type="submit" att1="C" att2="D" value="Delete" />
</form>

<script>
  function Ctrl($scope) {
    $scope.submit = function() {
      alert(this.att1)
      alert(this.att2)
    }
  }
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:33:24+00:00Added an answer on June 13, 2026 at 8:33 am

    You can use ng-click to change values on your scope prior to submission

    <form ng-submit="submit()" ng-controller="Ctrl">
      <input type="submit" ng-click="setAtts('A', 'B')" value="Edit" />
      <input type="submit" ng-click="setAtts('C', 'D')" value="Delete" />
    </form>
    
    <script>
      function Ctrl($scope) {
        $scope.submit = function() {
          alert($scope.att1);
          alert($scope.att2);
        };
    
        $scope.setAtts = function(a1, a2) {
          $scope.att1 = a1;
          $scope.att2 = a2;
        };
      }
    </script>
    

    Edit: As a side note $event will not work for ng-submit, if you’re interested in using $event.target (which probably shouldn’t be done from a controller anyhow)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my page I'm using a form which on submit should get some extra
// Find smallest year int pastMin=0; int currentMin=ontarioBankInfoInt.get(0); int currentMinIndex=0; int reps=(ontarioBankInfoInt.size()-1)/3; for(int x=0;
find . -type f -print prints out ./file1 ./file2 ./file3 Any way to make
find . -type f | xargs file | grep text | cut -d':' -f1
i find a lot of questions about this problem but i did not solve...
So the code that I have so far is: <fieldset id=LinkList> <input type=text id=addLinks
I know how to trigger a button click via jquery. : $('#hiddenSendButton').trigger('click'); What I
I have a simple form with one input. The page is located here: Actual
I am trying to add a submit and a clear button to a quicksearch
I'm developing a search form with a button that adds up to 4 State/City

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.