title: JQuery set form action in ajax script
body: <p>I am using this code:</p>
  
  <pre><code> var frm = $('#myform');
      frm.submit(function (ev) {
  
          $.ajax({
              type: frm.attr('method'),
              url: frm.attr('action'),
              data: frm.serialize(),
              success: function (data) {
                  alert('ok');
  
              }
          });
  
          ev.preventDefault();
      });
  </code></pre>
  
  <p>I Tried:</p>
  
  <pre><code>frm.submit(function (ev) {
  
     $("#myform").attr('action', 'myurl');
  
      .....
  </code></pre>
  
  <p>But that didn't work.</p>
  
  <p>Is there a way to set the form action url after "frm.submit(function (ev) {" ?</p>