4

この基本的なプロセスを含むページがあります。

  • ダウンロードしたいフォームの横にあるチェックボックスをクリックします
  • 送信をクリック
  • 基本的な情報を収集するために 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 サブミットを行う必要がありますか?

4

1 に答える 1

0

Lieghが示唆したよう<cfform>に、通常の代わりに使用すると機能しました。<form>

于 2016-04-04T18:49:39.033 に答える