MPG haven’t built-in solution for passing data to Ninja Forms, MPG just a pages generator.
But if you have experience with php and javascript, you can try to create custom route for ajax call, get needed data on a server side using do_shortcode([mpg]...[/mpg] ), then, on page load request this route, split obtained data into DOM-nodes and replace options in Ninja Form to nodes that you create from the server data.
But simple answer to your question – no, it’s not possible.
The closest thing they have is this:
https://ninjaforms.com/blog/populate-list-field/
But I have no idea how you could hook into that on the backend. (I know just enough php to be dangerous and I don’t think its’s practical for me to take that on!)
Thanks for your answer though- guess I need to find one of my programmer friends that knows some php.
Hi.
In MPG ver. 2.8.8, which will be released soon, I’ve added a public route for ajax calls that allow you to perform requests for rendering [mpg] shortcodes.
Example: http://joxi.ru/KAgVxYECNdJzL2
So, you can add an “onclick” handler to some country dropdown, send a request to the server to get cities list in this country, and override options in Ninja-generated dropdown by values from your server.
It should work, but I’m not sure if Ninja forms will correctly show values in the dashboard, which wasn’t specified when the form was built. Maybe Ninja will correctly show only predefined values.