Hi folks,
im just setting up a new site for a real estate agent. On the single views of the objects there is an “object-id” which I want to transmit to a CF7 form. Therefore I’ve added a button in the single view which opens the site with the form. Additonally I’ve added a jquery function in the wp_footer area of the GP-Hooks. But this does’nt seems to work and I’m not a professional coder to get this solved. Is anyone here who might have an idea?
Please see here for details (single view):
https://www.auf-dem-land-wohnen.de/wordpress/immobilien/2017-05-barssel/
The orange button on the single view should “transfer” the object_id to the following form and fill it in the input area:
https://www.auf-dem-land-wohnen.de/wordpress/objektanfrage/
This is the code I used in the wp_footer hook area:
<script>
jQuery(function($){
let objNr = $('#eckdaten li span.objektnummer').html();
$('input[name="object_id"]').val(objNr);
})
</script>
The orange button is added with the shortcode ultimate plugin like this:
[su_button url="https://www.auf-dem-land-wohnen.de/wordpress/objektanfrage/" target="self" style="default" background="#ff9900" color="#FFFFFF" size="10" wide="no" center="no" radius="auto" class="pull-right right30"]Jetzt Anfrage stellen[/su_button]