Skip to content

Instantly share code, notes, and snippets.

@thecfguy
Last active September 13, 2018 21:05
Show Gist options
  • Save thecfguy/6260057 to your computer and use it in GitHub Desktop.
Save thecfguy/6260057 to your computer and use it in GitHub Desktop.
Create coldfusion window and submit form to display response in cfwindow.
<cfajaximport tags="cfwindow">
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-all.js"></script>
<script>
function submitMe(){
var frm = window.document.frmTest;
ColdFusion.Window.create("Windowresponse","Response Window","",{x:100,y:100,height:200,width:400,modal:true,closable:true,draggable:true,resizable:true,center:true,initshow:true});
objWin = ColdFusion.Window.getWindowObject("Windowresponse");
var objupdate = objWin.getUpdater();
objupdate.update({url:frm.action,params:Ext.lib.Ajax.serializeForm("frmTest"), method:"POST",scripts:true});
}
</script>
<form action="testresponse.cfm" name="frmTest">
<input name="field1" type="text" value="hello there!" />
<input name="btnSubmit" onclick="submitMe()" type="button" value="Submit Me" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment