The only way to achieve this is to use a custom script file.
Load the script on the page where your form is being loaded using the following back-end function in your functions.php
file,
add_action( 'wp_enqueue_scripts','register_custom_script');
//its important to register the script, else it will not load properly.
function register_custom_script(){
wp_register_script( 'custom-cf7-script', <url to your script file>, array( 'jquery' ), null, true );
}
add_filter( 'do_shortcode_tag','load_custom_script', 10,3);
function load_custom_script($output, $tag, $args){
if('contact-form-7' != $tag){
return $output; //not a cf7 form shortcode.
}
if(!isset($attr['id']) || <yourform-id> != $attr['id']){
return $output; //not your form
}
//load your custom script that you previously registered.
wp_enqueue_script( 'custom-cf7-script');
}
in your custom script you’ll want to do something like,
(function($){
$(document).ready(function(){
var $select = $('#language-drop-down');
var $hidden = $('#textfield1');
$select.on('change',function(){
if("spanish"==this.value) $hidden = "/filedirectory/for/spanish/templatefile";
});
})
})(jQuery)