I'm trying to override the paypal submit form below to run some ajax before submitting but for some reason everything up till submitting the actual form is working.

**Paypal Form**

```
<form name="_xclick" id="payWithPaypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="email@website.com">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="item_name" value="Item Name Here">
    <input type="hidden" name="amount" value="12">
    <input type="hidden" name="return" value="http://www.website.com">
    <input type="hidden" name="notify_url" value="http://www.website.com/ipn.php">
    <input type="submit" id="submitPaypal" class="mailsubmit" value="Pay Now" border="0" name="submit">
</form>

```

**Overriding the submit button**

```
<script>
    $(function(){
        $('#submitPaypal').on("click", function(e){
            event.preventDefault();
            tailor();
        });
    });
</script>  

```

**Ajax that should run then submit the above form**

```
   <script type="text/javascript">
        function tailor(){
             $.ajax({
                url: "info.php",
                type: "POST",
                data: {NAME:"test"},
                success: function(data){
                     $('#payWithPaypal').submit();
                }
           });
        }
    </script>

```

Any insight as to why `$('#payWithPaypal').submit();` isn't working would be greatly appreciated