Submission of form not working after deployed on vercel.
abhishekOptiphoenix opened this issue · comments
We use the admin-ajax.php
URL for form submission. So, you may encounter the CORS Issue. An error: TypeError: NetworkError when attempting to fetch resource.
will be thrown in the console and the Cross-Origin request will be blocked. This will prevent the form from submission. So you need to add the new location in allowed_http_origins
filter hook.
If you are using WP Job Openings REST API Example plugin, you can add the new address here:
https://github.com/awsmin/wp-job-openings-rest-api-example/blob/265cf8b2c1f04abae0d198e844b8307a9855a459/rest-api.php#L86
Readme
https://github.com/awsmin/frontity-wp-job-openings#cors-issue
We use the
admin-ajax.php
URL for form submission. So, you may encounter the CORS Issue. An error:TypeError: NetworkError when attempting to fetch resource.
will be thrown in the console and the Cross-Origin request will be blocked. This will prevent the form from submission. So you need to add the new location inallowed_http_origins
filter hook.If you are using WP Job Openings REST API Example plugin, you can add the new address here: https://github.com/awsmin/wp-job-openings-rest-api-example/blob/265cf8b2c1f04abae0d198e844b8307a9855a459/rest-api.php#L86
Readme https://github.com/awsmin/frontity-wp-job-openings#cors-issue
thanks, it worked after adding the filter hook in function.php.