gpt4 book ai didi

coldfusion - CFWINDOW - 在 CF 中提交表单以留在 CFWindow 中

转载 作者:行者123 更新时间:2023-12-01 06:08:05 25 4
gpt4 key购买 nike

我有一个包含这个基本过程的页面:

  • 单击要下载的表单旁边的复选框
  • 点击提交
  • CFWindow 弹出以收集一些基本信息
  • 点击提交下载表格,同时停留在CFWindow打开的窗口

  • 当您单击 CFWindow 内的提交按钮时,它会将您带回父页面。我希望表单提交留在 CFWindow 中。我看到了这个帖子: Refresh cfwindow content .然而, refreshOnShow = "true"不起作用。每次我点击提交时,它都会返回到父窗口。

    这是父页面:
    <cfform name="myform">
    <cfinput type="hidden" name="OrgID" value="#getit.orgID#">
    <table width="95%" border="0" cellspacing="5" cellpadding="0" align="center">
    <tr>
    <td width="50%" valign="top" class="coretextforBR">
    <cfinput type="checkbox" name="GetThese" value="#form_ID#">
    <a class="corelinkforBR">#Forms_Name#</a>
    <br /><br />
    #Forms_Description#
    <br /><br />
    </td>
    </tr>
    <tr>
    <td width="50%" valign="top" class="coretextforBR">
    <cfinput type="checkbox" name="GetThese" value="#form_ID#">
    <a class="corelinkforBR">#Forms_Name#</a>
    <br /><br />
    #Forms_Description#
    <br /><br />
    </td>
    </tr>
    <tr>
    <td width="50%" valign="top" class="coretextforBR">
    <cfinput type="checkbox" name="GetThese" value="#form_ID#">
    <a class="corelinkforBR">#Forms_Name#</a>
    <br /><br />
    #Forms_Description#
    <br /><br />
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <input type="submit"value="Get It" onclick="javascript:ColdFusion.Window.show('mywindow1')">
    </td>
    </tr>
    </table>
    </cfform>

    <cfwindow x="250" y="250" width="400" height="400"
    name="mywindow1" title="Almost ready to download" initshow="false" draggable="false" resizable="false"
    refreshOnShow="true" source="submitform.cfm?GetThese={myform:GetThese.value}&OrgID={myform:OrgID}&action=information"
    bodystyle="background-color: white;" headerStyle="background-color: ###getcss.color#; font-family: #getcss.font#; color: ###getcss.fontcolor#;" />

    这是 CFWwindow 的源代码 (submit.cfm):
    <cfparam name="attributes.action" default="information">
    <cfoutput>
    <html>
    <head>
    <style type="text/css">
    </style>
    </head>
    <body>
    This window will collect information to begin download
    <br>
    <!--- action for downloading --->
    <cfif attributes.action eq "download">
    <cfloop info and stuff left out>
    <a href="./log_download.cfm?filename=#Forms_File#&OrgID=#UrlEncodedFormat( '#Forms_OrgID#' )#" class="corelinkforBR">#Forms_Name#</a><br />
    </cfloop>
    <!--- what you see when page initially loads --->
    <cfelse>
    <form action="submitform.cfm?action=download" method="post">
    <input type="hidden" name="GetThese" value="#attributes.GetThese#">
    <input type="hidden" name="OrgID" value="#attributes.OrgID#">
    <table width="95%" border="0" align="center">
    <tr>
    <td class="coretextforBR">First:</td>
    <td><input type="text" name="CollectedInfo_First"></td>
    </tr>
    <tr>
    <td class="coretextforBR">Last:</td>
    <td><input type="text" name="CollectedInfo_Last"></td>
    </tr>
    <tr>
    <td class="coretextforBR">Phone:</td>
    <td><input type="text" name="CollectedInfo_Phone"></td>
    </tr>
    <tr>
    <td class="coretextforBR">Email:</td>
    <td><input type="text" name="CollectedInfo_Email"></td>
    </tr>
    <tr>
    <td class="coretextforBR">Best way <br> to contact:</td>
    <td><input type="text" name="CollectedInfo_BestWay"></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit" value="Download" class="button one"></td>
    </tr>
    </table>
    </form>
    </cfif>
    </cfoutput>
    </body>
    </html>

    我不知道我做错了什么。除了 refreshOnShow 之外,我找不到我的问题的明确答案。 .我应该重新考虑并进行ajax提交吗?

    最佳答案

    使用 <cfform>而不是正常 <form>按照 Liegh 的建议工作。

    关于coldfusion - CFWINDOW - 在 CF 中提交表单以留在 CFWindow 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36136708/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com