I have a simple input field inside a form tag:
I've confirmed that setting the value of a hidden field does not work with a jQuery selector like this...
$('[name="my_field"]').val('Something');
Will not update a hidden field... kinda shocking.
Was forced to use a CSS hidden field instead.
Apparently there are other issues with using the id of a hidden field as well... Set value of hidden field in a form using jQuery's ".val()" doesn't work
Note: be sure to obtain the value in the console and not by inspecting.
$('[name="my_field"]').val();