I have a website with multiple pages using the same form in footer. The footer is included through php, so it's the same on every page. I want to identify the page which message was sent from.
So basically on every page I specify the page-id parameter (thought the would be a good idea?):
<a class="page-id" name="page-a"></a>
then in footer inside the actual form I will get a hidden input field with auto-filled value of "page-a" defined on the actual page:
<input class="which-page" type="text" value="">
so I want the input to look like this after auto-implenentation of the value:
<input class="which-page" type="text" value="page-a">
I was trying to use jquery to implement this dynamically, but I'm not very good at it. Here is what I have.
$pageid = $('.page-id').find('name').clone().text('');
$('.which-page').find('value').contents().wrap($pageid);
Thank you