How to get the previous URL in Form message

  contact-form, contact-form-7, javascript, wordpress

I am working on a WordPress site, where I have created a Contact Form.

So whenever someone clicks to apply for a job advert it takes them to a Contact Form

Example site – https://www.inext.se/job/solution-architect/

Application Contact Form – https://www.inext.se/job-apply-form/?id=6770

Now I am trying to get is the previous URL subject/title or the previous URL.

In JavaScript, I know it is possible to get it by –

<script type="text/javascript">
    document.write(document.referrer);
</script>

But I didn’t find anywhere how to get in a form mail message body.

I have tried to use –

[_url]
[_post_name]
[_post_title]

But this gives me the form URL which is useless for me.

Do anyone know any solution!

Source: Ask Javascript Questions

LEAVE A COMMENT