If you want to submit Form data to different URLs based on selection of select box, You have to do some lengthy code in jQuery or Javascript. But it is very easy build this logic using AngularJS.

Markup

<form action="{{action}}" ng-submit="alertAction($event)">
  <select ng-model="action">
    <option value="action1">Action 1</option>
    <option value="action2">Action 2</option>
    <option value="action3">Action 3</option>
  </select>
  <h4>Action attribute value</h4>
  <div ng-bind="action"></div><br/>
  <button>Submit</button>
</form>

Script

$scope.action = 'action2';
$scope.alertAction = function($event) {
    alert($scope.action);
    $event.preventDefault();
};

8 comments:

  1. You have to do some lengthy code in jQuery or Javascript. C_ARSUM_19Q2 dumps

    ReplyDelete
  2. You have to do some lengthy code

    ReplyDelete
  3. What if we could tell our web pages what to do based on the users choice? AngularJS gives us this ability! In this write my thesis tutorial, you will learn how to use ng-model to change the form action based on select boxes and checkboxes.

    ReplyDelete
  4. I believe this will help your website become more organized because you have decided to set a part on this site for the inquiries regarding tax and as well as the helpful discussions. To be honest, this is one of the few sites that are doing this kind of strategy. Also, I think that this will not only benefit your clients or the potential ones but you most especially someone write my assignment because you will be able to see the questions easier.

    ReplyDelete
  5. This programming language is complex and difficult to understand, but it is most wanted and many professionals have secured their future through learning it and they can earn a lot of money. If you are jobless and interested in this field, you should learn this language at any cost. Assignment writing services.

    ReplyDelete
  6. Thanks for sharing this best stuff with us! Keep sharing! I am new in the blog writing.All types blogs and posts are not helpful for the readers.Here the author is giving good thoughts and suggestions to each and every readers through this article.Quality of the content assignment helper uk is the main element of the blog and this is the way of writing and presenting.

    ReplyDelete
  7. This is a good idea for people who actually have some questions or inquiries about this topic. I am so excited to see the discussions that will be made on this thread regarding taxes. writing help uk I have to say that this kind of topic should really be discussed thoroughly to people who finds it helpful so that there won't be no

    ReplyDelete
  8. I clearly stumbled upon your weblog and favored to mention that I’ve truely loved reading your blog posts. anyhow I’ll be subscribing in your feed and that i wish you submit once more quickly. Please keeps it get assignment done top posting! thanks you a lot, I recognize your work.

    ReplyDelete

Blogroll

Popular Posts