$modx->regClientStartupHTMLBlock('
<script>
Ext.onReady(function(){
var nameInput = Ext.get("modx-template-templatename");
var staticFile = Ext.getCmp("modx-template-static-file");
staticFile.setValue(nameInput.getAttribute("value") + ".tpl");
});
</script>');