You might need to add some checks here :
<script type="text/javascript">
jQuery(document).ready(function(){
if( jQuery('form.acf-form').get(0) ){
jQuery('form.acf-form').append('<input type="hidden" name="acf[post_ID]" value="' + acf.o.post_id + '"/>');
jQuery('form.acf-form').append('<input type="hidden" name="acf[frontend]" value="true"/>');
}
});
</script>