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 –

Application Contact Form –

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">

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

I have tried to use –


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

Do anyone know any solution!

Source: Ask Javascript Questions