Cannot prefill hidden Ninja Forms fields

According to https://developer.ninjaforms.com/codex/changing-field-values/ you need to add .trigger( ‘change’ ) when changing Ninfa Forms field values programmatically. This should work: if(jQuery(‘#broker-list’).length) { //checks if the list exists jQuery(document).on( ‘nfFormReady’, function( e, layoutView ) { var broker_name = “”; jQuery(document).on(“click”, “.broker” , function() { broker_name = jQuery(‘.broker__name’, this).text(); console.log(broker_name); // this works perfectly if(jQuery(‘#nf-field-33’).length) { jQuery(this).val(broker_name).trigger( … Read more

Ninja form Redirect depending on text field content [closed]

I am not sure whether you have hooked this function to appropriate action. Also you have not concatenated the strings properly: Instead of $newdestinationurl = $url/$destinationurlslug ; it should be $newdestinationurl = $url.”https://wordpress.stackexchange.com/”.$destinationurlslug ; Please see below for the complete code: function ninja_forms_handler() { add_action ( ‘ninja_forms_post_process’, ‘change_ninja_forms_landing_page’, 1, 2 ); } add_action(‘init’, ‘ninja_forms_handler’); function … Read more

Create unique identifier that is displayed to the user and admin via Ninja Forms

Put this code into theme’s functions.php: ( for Ninja Forms 2.9.x ) function unique_code_submission( $data, $field_id ) { global $uniqueCode; if ( “string” !== gettype( $uniqueCode ) ) $uniqueCode = uniqid(); /* here goes your code to populate a field */ return $data; } add_filter( ‘ninja_forms_field’, ‘unique_code_submission’, 10, 2 ); Within above function you will … Read more

How to add a class for ninja form field_table?

There is a filter named ninja_forms_action_email_message that you could use to manipulate the email message body. I never tried, in the end I preferred to avoid using {fields_table} as a whole and manually created the HTML + styling in the form settings by specifying each single field manually.