Reputation: 1388
I am new to Angularjs. Currently i have code like this that submits the form on button click
<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 that form should be submitted on selecting the option without need of the submit button
Upvotes: 4
Views: 279
Reputation: 42669
I believe you can use ng-change
here
<select ng-model="resultsPerPage" ng-change="reloadA(resultsPerPage)">
Upvotes: 1
Reputation: 5207
ok, for this you should have that ng-submit
function in the select, like this;
<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>
Upvotes: 2