Angular js form submit

I am new to Angularjs. I currently have a code that submits a form to a button

<form ng-submit="reloadA(resultsPerPage)">
    <select ng-model="resultsPerPage">
    <option value="10">10</option>
    <option value="25">25</option>
    </select>
     <input type="submit" id="submit" value="Submit" />
    </form>

I need the form to be submitted when selecting an option without a submit button

+4
source share
2 answers

ok, for this you must have this function ng-submitin the selection, for example:

<form>
   <select ng-change="reloadA(resultsPerPage)" ng-model="resultsPerPage">
      <option value="10">10</option>
      <option value="25">25</option>
   </select>
   <input type="submit" id="submit" value="Submit" />
</form>
+2
source

I think you can use ng-changehere

<select ng-model="resultsPerPage" ng-change="reloadA(resultsPerPage)">
+1
source

All Articles