JQuery Changing form url after submitting form
<p>I have run into a strange problem, I am changing form url after form submission. I have changed form fields and they are changing perfectly but action url is not changing... Here is HTML code..</p>

<pre><code>&lt;form action="" method="post" id="payment-form"&gt;
    &lt;input type="hidden" id="email" name="email" value=""&gt;
    ....
&lt;/form&gt;
</code></pre>

<h2>JQuery Code</h2>

<pre><code>$.ajax({
    url: form_url,
    type: 'post',
    context:this,
    data: $("#payment-form").serialize(),
    dataType: 'json',
    success: function(data) {
        if(data.success) {
            $('#payment_form').attr("action", data.url);
            $('#email').val(data.email);
            alert($("#payment-form").attr('action'));
            //$("#payment-form").submit();

        }
        else {
            $('#error').html(data.errors).addClass('error').fadeIn("slow").fadeOut(9000);
        }
    }
});
</code></pre>

<p>The alert shows me no url, why is that?</p>

<h2>Update</h2>

<p>I have setup <code>$('#payment_form').attr("action", data.url);</code> it shows me no url but <code>alert(data.url)</code> shows me url.</p>
