Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active August 3, 2022 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjohnson/fdba753c10da8d556f36811e71d7d7da to your computer and use it in GitHub Desktop.
Save kjohnson/fdba753c10da8d556f36811e71d7d7da to your computer and use it in GitHub Desktop.
var fieldID = 197;
var newValue = 'compactpro';
jQuery( '#nf-field-' + fieldID ).val( newValue ).trigger( 'change' );
@pixeldiebe
Copy link

I want to use jQuery to fill out a hidden field. The value is will be read from an Tag with a "data" ATTR.
I used the .trigger('change') function but it's not working.
It's a multi-step form and as soon as I'm changing the step the field will be empty.

Is there any way to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment