Is it possible to add a button id to the form buttons? “Submit” because I need to track Google Webmaster to see whether it is possible.
Hi @Parthasarathika,
If you work with the default form module provided by HubSpot you have to use some jQuery/JavaScript to add an id.
If it has to be the same id on all your pages you can add
$('form input[type="submit"]').attr('id', 'YOUR-ID');
to your theme/pages.
If you’d like to have it automatically generated you can modify it with some hubl like this
$('form input[type="submit"]').attr('id', 'form-button-{{name|md5}}');
note: the “|md5” is optional but will give you an id like
#form-button-1234982345532 instead of #form-button-hjk_we57893223
If you want to enter your Id manually you can create a custom module with a simple text element like this
$('form input[type="submit"]').attr('id', '{{ module.my_custom_id }}');
and place it into your layout.html of the theme. By doing so you will have the ability to enter a custom id per page manually.
hope this helps,
best,
Anton
no i need button id not page id
