I'm trying to submit a form on my website (xyz.com) to Salesforce. When I click submit, I get this error

Access to XMLHttpRequest at 'https://webto.salesforce.com' from origin 'https://www.xyz.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I've whitelisted the origin URL (https://www.xyz.com) and doesn't seem to work.


<form class="myForm" action="https://webto.salesforce.com" method="POST">
    <input type="text" class="myInput">

<div class="msg">Sent!</div>



    type: 'POST',
    url: $('.myForm').attr('action'),
    data: $('.myForm').serialize(),
    success: function(response) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.