• Taoufiq Benallah 1
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,

I am receving the velow error when record submitted via web form. this functionality developed using web-lead .
Error:
Access to XMLHttpRequest at 'https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8' from origin 
'https://author-uat.aem.avi.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. 

Web-Lead Form:
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">

<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: Please add the following <FORM> element to your page.             -->
<!--  ----------------------------------------------------------------------  -->

<form action="https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<input type=hidden name="oid" value="1198D1x111118glX">
<input type=hidden name="retURL" value="https://google.com">

<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: These fields are optional debugging elements. Please uncomment    -->
<!--  these lines if you wish to test in debug mode.                          -->
<!--  <input type="hidden" name="debug" value=1>                              -->
<!--  <input type="hidden" name="debugEmail"                                  -->
<!--  value="pawar.radhika@avivainvestors.com">                               -->
<!--  ----------------------------------------------------------------------  -->

<label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

<label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" Required/><br>

<label for="email">Email</label><!--<input  id="email" maxlength="80" name="email" size="20" type="text" Required/><br>-->
<input id="email" name="email" type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" /><br>

<label for="company">Company</label><input  id="company" maxlength="40" name="company" size="20" type="text" Required/><br>
<input type="submit" name="submit">

</form>