Hi,
I would love to be able to change the URL in the page editor where I have a dedicated URL field for that
> response_redirect_url=“{{ module.form_field.redirect_url }}”
Right now, I am using a hard coded URL which is not very convenient for the marketers when they want to make the changes!
This is the code that I am using to do a redirect to page when I submit a form :
<div class="form-box form-box-{{ module.background_color }} shadow-box align-{{ module.align }}">
<div class="wrap-course-info">
<{{ module.title_tag }}>{{ module.title }}</{{ module.title_tag }}>
{% if module.description %} <p class="title-description2">{{ module.description }}</p>{% endif %}
{% if module.text %} {{ module.text }}{% endif %}
{% form
form_to_use="{{ module.form_field.form_id }}"
response_response_type="{{ module.form_field.response_type }}"
response_message="{{ module.form_field.message }}"
response_redirect_id="{{ module.form_field.redirect_id }}"
response_redirect_url="{{ module.form_field.redirect_url }}"
gotowebinar_webinar_key="{{ module.form_field.gotowebinar_webinar_key }}"
%}
<script>
window.addEventListener('message', event => {
if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
window.location.href = "mywebsite.com" + `?email=${event.data.data.submissionValues.email}`;
console.log("email", event.data.data.submissionValues.email, event.data.data);
console.log("Dynamic URL:", event.data.data.submissionValues.redirectUrl);
}
});
</script>
</div>
</div>
This Console printed > Undefined
console.log("Dynamic URL:", event.data.data.submissionValues.redirectUrl);
These are the ones I tested to substitute the URL “mywebsite.com”:
1/
![]()
2/
![]()
3/
![]()
any ideas how can I target : response_redirect_url=“{{ module.form_field.redirect_url }}” within the JavaScript snippet?
Best regards,
Azhar Bondi