How can i call a hubspot form field to autofill with window.location.href

contacts

#1
<div style="position: relative; top: -70px; margin-top: 30px;"><button type="button" class="button continue_browsing pull-right" style="margin-top:15px;" id="emailCartBTN">Email this Cart</button></div>
×

#2

Hi @Roxana_Carrion,

I'm not entirely clear on that code's function, but here's an example of code that will populate an example field with the current URL:

$('input[name="example_field"]').val(window.location.href).change();