Hi, I would like to record the URL of the page from which a form is submitted. The form is included in a modal iframe. Is this possible and how do I go about doing this?
I have searched the forum to no avail :-(
Regards
Richard
Started 11 months ago by lamina | 5 posts |
Hi, I would like to record the URL of the page from which a form is submitted. The form is included in a modal iframe. Is this possible and how do I go about doing this?
I have searched the forum to no avail :-(
Regards
Richard
This possible with some customization. First of all, you need to add 1 single line text field into your form to hold the page url data. Then edit "includes/view-functions.php" file and go to around line 1682, you'll see these code :
$element[$j]->default_value = htmlspecialchars($row['element_default_value']);
then put these code bellow that line
if ($form_id == 9 && $element[$j]->id ==1 ) {
$element[$j]->default_value = $_SERVER['HTTP_REFERER'];
}
After that, you can add these css code to hide the new field.
#li_1 {
display:none !important;
}
In there I assume your form id is 9 and the field element id to hold url data is 1. You need to change those id's with yours.
MachForm Support
Hi redityo,
Thank you for the prompt reply. I cannot find the $element[$j] line in includes/post-functions.php - I am using the latest Machform version 2.4. Can you assist please?
Many thanks
Richard
Hi, could this post please be updated to cover the syntax changes in post-functions.php (v2.4)? A lot has changed in there and I'm having a hard time figuring out how to use the method above.
Thanks,
Winston
Hi Winston,
The file name should "view-functions.php", you can try to search the code in there. For version 2.4 the line is on 1690
MachForm Support
You must log in to post.