I've not used the JS code to edit the form like that. But you can try to use AJAX with the function wp_remote_get() to get the form config and value then display it on your page. Please read more on this documentation https://developer.wordpress.org/reference/functions/wp_remote_get/