APIs & Integrations

DavidFJones
Member | Platinum Partner
Member | Platinum Partner

HTML Form Redirect to same page

SOLVE

Hey all,

I am building a custom cms theme and need a custom form to be included in one of the pages. 

I'm having issues getting the form to properly redirect to the same page. Currently this is my opening form tag - 

<form action="{{request.path}}" method="POST" class="profile-form" enctype="multipart/form-data">

However, when users submit this form, the page they are shown just shows 
"Request Forbidden" on screen. 

This form contains a name input, an email input, and a file upload input.

 

0 Upvotes
1 Accepted solution
DavidFJones
Solution
Member | Platinum Partner
Member | Platinum Partner

HTML Form Redirect to same page

SOLVE

I figured out what the issue is. Currently with HubSpot, and third party/outside form will only work with GET requests, and not post. Changing the opening tag to have a GET request fixes this issue

<form action="{{request.path}}" method="GET" class="profile-form" enctype="multipart/form-data">

View solution in original post

0 Upvotes
1 Reply 1
DavidFJones
Solution
Member | Platinum Partner
Member | Platinum Partner

HTML Form Redirect to same page

SOLVE

I figured out what the issue is. Currently with HubSpot, and third party/outside form will only work with GET requests, and not post. Changing the opening tag to have a GET request fixes this issue

<form action="{{request.path}}" method="GET" class="profile-form" enctype="multipart/form-data">
0 Upvotes