Сделать выпадающий выбор отображать определенную информацию. с кнопкой продолжения - PullRequest
0 голосов
/ 30 апреля 2020

На моем сайте есть выпадающее меню для выбора того, как клиент хочет заплатить. Когда я выбираю Заказ на покупку или Кредитную карту, он работает нормально и отображает таблицу с информацией о цене. И т. Д. c.

Но когда я выбираю «Запрос на предложение», он не отображает таблицу с информация о ценах. совсем. Ниже мой код для выпадающего меню. Как получить таблицу для отображения, когда выбран Запрос на предложение?

    <cfif CreditAccount_Value IS not 1>                               

<cfif isDefined('form.PaymentMethod') AND form.PaymentMethod NEQ "">
<cfset form.PaymentMethod = form.PaymentMethod>
</cfif>


<tr>
    <td>Payment:</td>
    <td><select name="PaymentMethod" required="yes" onChange="this.form.submit()">
    <option value="" selected>Payment Method</option>
    <option value="Credit Card" <cfif isDefined('form.PaymentMethod') and form.PaymentMethod eq 'Credit Card'>selected</cfif>>Pay On-Line with Credit Card</option>
    <option value="PO" <cfif isDefined('form.PaymentMethod') and form.PaymentMethod eq 'PO'>selected</cfif>>Purchase Order</option>
    <!---<option value="COD" <cfif isDefined('form.PaymentMethod') and form.PaymentMethod eq 'COD'>selected</cfif>>COD</option> --->
    <option value="RFQ" <cfif isDefined('form.PaymentMethod') and form.PaymentMethod eq 'RFQ'>selected</cfif>>Request For Quote</option>
    </select>
    </td>
</tr>





<table border=0>
<tr>
<td><font color="red">
If using a P.O. number, please call Ironwood (952)229-8200 to verify

<br>
credit has been established with your company.
</font>
</td>
</tr>
</table>

                                <cfelse>
                                      <tr>
                                        <td>Payment By:</td>
                                        <td>Credit Card</td>
                                    </tr>    
                                      <input type="hidden" name="PaymentMethod" value="Credit Card">

                                </cfif>
                                <cfelseif timesthrough IS 2 >
                                    <!---<tr>
                                        <td>Shipping By:</td>
                                        <td><cfoutput>#session.ShippingMethod#</cfoutput></td>
                                    </tr> --->
                                 <cfif #session.PaymentMethod# IS "PO">
                                <tr>
                                        <td>Payment By:</td>
                                        <td>Purchase Order <cfoutput>#session.po#</cfoutput><!--- Charge to Account No. ---> <!--- #session.AccountNumber# ---></td>
                                    </tr> 
                                <cfelseif #session.PaymentMethod# IS "COD">
                                <tr>
                                        <td>Payment By:</td>
                                        <td>COD</td>
                                    </tr>    
                                <cfelseif #session.PaymentMethod# IS "RFQ">
                                <tr>
                                        <td>Payment By:</td>
                                        <td>Request For Quote</td>
                                    </tr>       
                                <cfelseif timesthrough IS 2 AND #session.PaymentMethod# IS "Credit Card">
                                    <tr>
                                        <td>Card Type:</td>
                                        <td><select name="CardType">
                                                <option value="V">Visa</option>
                                                <option value="M">Master Card</option>
                                                <option value="A">American Express</option>
                                                <!--- <option value="D">Discover</option> --->
                                        </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Card Number:
                                        </td>
                                        <td ><input type="text" name="CardNumber" size=25 maxlength=35 required>
                                                </td>
                                        <td></td>
                                    </tr>


<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>

                                    <tr>
                                        <td>CVV Code:
                                        </td>
                                        <td ><input type="text" name="CodeNumber" size=6 maxlength=4 required> &nbsp; <a href="#" onClick="MM_openBrWindow('cvv.html','CVV Number','resizable=yes,width=575,height=500')" style="font-size:11px">What is my CVV code?</a></td>



                                    </tr>
                                    <tr>
                                        <td>Card  Expires:</td>
                                        <td><select name="CardExpMonth">
                                            <option value="01">Jan</option>
                                            <option value="02">Feb</option>
                                            <option value="03">Mar</option>
                                            <option value="04">Apr</option>
                                            <option value="05">May</option>
                                            <option value="06">Jun</option>
                                            <option value="07">Jul</option>
                                            <option value="08">Aug</option>
                                            <option value="09">Sep</option>
                                            <option value="10">Oct</option>
                                            <option value="11">Nov</option>
                                            <option value="12">Dec</option>
                                        </select>
                                        <!--- Modified by: MTP on 7/14/03. Added logic to update the year so it
                                        is dynamic. This will display the current year + 5 years ahead. 
                                         --->
                                        <cfset CurrentDate = DateFormat(NOW(),"mm/yyyy")> 
                                        <cfoutput>
                                        <select name="CardExpYear">
                                            <option>#DateFormat(CurrentDate,"yyyy")#</option>
                                            <cfloop from="1" to="5" index="Next">
                                                <cfset NextYear =  DateAdd("yyyy",Next,CurrentDate)>
                                                <option>#DateFormat(NextYear,"yyyy")#</option>
                                            </cfloop> 
                                        </select> 
                                        </cfoutput>
                                        </td>
                                    </tr>
                                    </cfif>
                                <cfelseif timesthrough GTE 3>
                                    <cfoutput>
                                    <!---<tr>
                                        <td>Ship By:</td>
                                        <td>#session.ShippingMethod#</td>
                                    </tr> --->
                                     <cfif #session.PaymentMethod# IS "PO">
                                     <tr>
                                        <td>Payment By:</td>
                                        <td>Purchase Order<!--- : #session.po# ---> </td>
                                    </tr>    
                                     <cfelseif #session.PaymentMethod# IS "COD">
                                     <tr>
                                        <td>Payment By:</td>
                                        <td>COD</td>
                                    </tr>  
                                     <cfelseif #session.PaymentMethod# IS "RFQ">
                                     <tr>
                                        <td>Payment By:</td>
                                        <td>Request For Quote</td>
                                    </tr>  
                                    <cfelse>
                                    <tr>
                                        <td>Card Type:</td>
                                        <td>
                                            <cfif session.CardType IS "A">
                                                American Express
                                            <cfelseif session.CardType IS "M">
                                                MasterCard
                                            <cfelseif session.CardType IS "V">
                                                VISA
                                            <cfelseif session.CardType IS "D">
                                                Discover
                                            </cfif>
                                        </td>
                                    </tr>
                  </cfif>
                                    </cfoutput>
                                </cfif> 
                            </table>
                        </td>
                    </TR>
                </table>
                </td>
            </TR>
        </table>
        <p>

Это работало до того, как я добавил раскрывающееся меню «Учетная запись доставки» в приведенном ниже коде:

    <!--- Entering UPS or FedEx Account Numbers --->
<table align=center width=30%>
<cfif isDefined('form.ShipAcctMethod') AND form.ShipAcctMethod NEQ "">
<cfset form.ShipAcctMethod = form.ShipAcctMethod>
</cfif>


    <!--- first drop down list --->  
    <!--- NOTICE the onChange javascript event in the select tag, this is what submits the form after the first selection --->

<cfif #session.UPSNumber# IS "" AND #session.FedExNumber# IS "" And Session.PaymentMethod IS NOT "RFQ">
<tr>
<td><font color="red">
Please provide your shipping account number:
</font>
</td>
</tr>

    <tr>
    <td>
    <select name="ShipAcctMethod" required="yes" onChange="this.form.submit()">
    <option value="" selected>Shipping Account</option>
    <option value="UPSNumber" <cfif isDefined('form.ShipAcctMethod') and form.ShipAcctMethod eq 'UPSNumber'>selected</cfif>>UPS Account Number</option>
    <option value="FedExNumber" <cfif isDefined('form.ShipAcctMethod') and form.ShipAcctMethod eq 'FedExNumber'>selected</cfif>>FedEx Account Number</option>
    </select>
    <br><br>

<cfoutput>
    <!--- Choose a selection --->
    <cfif isDefined('form.ShipAcctMethod') and form.ShipAcctMethod eq 'UPSNumber'>
        <input type="text"  maxlength="100"  size="30"name="UPSNumber" value="#session.UPSNumber#" placeholder="UPS Account Number" required>
        </td>
        </tr>

    <cfelseif isDefined('form.ShipAcctMethod') and form.ShipAcctMethod eq 'FedExNumber'>
        <input type="text"  maxlength="100"  size="30"name="FedExNumber" value="#session.FedExNumber#" placeholder="FedEx Account Number" required>
        </td>
        </tr>




<cfelseif #session.UPSNumber# IS NOT "">
    <tr><td width=260 valign=top><cfoutput><b>UPS Account Number:</b><br>#session.UPSNumber#</cfoutput></td></tr>   
<cfelseif #session.FedExNumber# IS NOT "">
    <tr><td width=260 valign=top><cfoutput><b>FedEx Account Number:</b><br>#session.FedExNumber#</cfoutput></td></tr>

 </cfif>        
 </cfoutput>


</table>

Код продолжается здесь с конца cf_PrintShoppingCart. cf_PrintShoppingCart - это то, что выводит таблицу, которую я хочу отобразить.

    <table align=center width=95%>
    <cfif timesthrough IS 1>  

    <tr>
        <td><cfoutput>Shipping Instructions:<br><textarea name="ShippingInstr" rows="4" cols="25">#session.ShippingInstr#</textarea></td>
        <td>Special Notes:<br><textarea name="SpecialNotes" rows="4" cols="25">#session.SpecialNotes#</textarea></cfoutput></td>
    </tr>
    <cfelse>
        <cfif #session.ShippingInstr# IS NOT "" OR #session.SpecialNotes# IS NOT "">
        <tr>
            <cfif #session.ShippingInstr# IS NOT "" AND #session.SpecialNotes# IS NOT "">
            <td width=260 valign=top><cfoutput><b>Shipping Instructions:</b><br>#session.ShippingInstr#</td>
            <td width=260 valign=top><b>Special Notes:</b><br>#session.SpecialNotes#</cfoutput></td>
        <cfelseif #session.ShippingInstr# IS NOT "" AND #session.SpecialNotes# IS "">
            <td valign=top><cfoutput><b>Shipping Instructions:</b><br>#session.ShippingInstr#</cfoutput></td>
        <cfelseif #session.ShippingInstr# IS "" AND #session.SpecialNotes# IS NOT "">
            <td valign=top><cfoutput><b>Special Notes:</b><br>#session.SpecialNotes#</cfoutput></td>
            </cfif>     
        </tr>
    </cfif>
</cfif>
</table>

<p>
<cfoutput>
<table align=center width=95% border=0>
    <tr>
    <cfif timesthrough GT 1>
        <td align="left">
        <cfif #session.OrderDescription# IS NOT "">
                Personal description of order: <b>#session.OrderDescription#</b>
        </cfif></td>
        <!--- <cfif #session.po# IS not "" and CreditAccount_Value IS not 1> --->
        <cfif   session.PaymentMethod IS "PO" AND  timesthrough IS 2>
        <td align="right">PO#Chr(35)#: <b>#session.po#</b><input type="text" name="po" value="" size="6" required></td><input type="hidden" name="timesthrough" value="3">
        <cfelseif session.PaymentMethod IS "PO" AND  timesthrough GT 2>
        <td align="right">PO#Chr(35)#: <b>#session.po#</b></td>
        </cfif>

    <cfelse>
        <td align="left">Personal description of order:
    <input type="text"  maxlength="100"  size="30"name="OrderDescription" value="#OrderDescription#"></td>
        <!--- <cfif CreditAccount_Value IS not 1 AND timesthrough GT 1> --->
        <cfif #session.PaymentMethod# IS "PO" AND timesthrough GT 1>

        <td align="right">PO#Chr(35)#: <input type="text" name="po" value="" size="6"></td>
        </cfif>
    </cfif>
    </tr>
</table>    
</cfoutput>

<!---Print the shopping cart info--->
<cf_PrintShoppingCart
     state="view">

В конце страницы также есть этот код:

    <table bgcolor="#application.headercolor#" align=center width=95%>
    <tr>
        <td width=30><font face=arial size="+1" color="#application.headerFontColor#">
                <input type="submit" name="Cancel" value="Cancel">
            </font>
        </td>

        <cfif timesthrough LT 3>
        <td align=center width="100%">
        <font face=arial size="+1" color="#application.headerFontColor#">
            <cfif timesthrough IS 1>
                When satisfied, press Continue
            <cfelseif timesthrough IS 2 AND #session.PaymentMethod# IS "PO">
                Enter PO Number and press Continue
            <cfelseif timesthrough IS 2>
                Enter credit card information and press Continue
            </cfif></font></td>
        <td width=30>

            <font face=arial size="+1" color="#application.headerFontColor#">
            <input type="submit" name="Refresh" value="Continue"></font></td>        
        <cfelseif timesthrough IS 3>
        <input type="hidden" name="orderitemscost" value="#CartAmount#">
        <input type="hidden" name="taxamt" value="#taxamt#">
        <input type="hidden" name="totalamt" value="#totalamt#">
        <td align=center width="100%"><font face=arial size="+1" color="#application.headerFontColor#">Your order will be submitted when you press Order.</font></td>
        <td width=30>
            <font face=arial size="+1" color="#application.headerFontColor#"><input type="submit" name="Order" value="Order"></font>
        </td>
    </tr>

        </cfif>

</table>
<cfif timesthrough IS 3>
<table align=center width=95%>

<tr align="center">
            <td nowrap align="right"><font face=arial size="3"><b>Prices are in US dollars.</b></font></td></tr>
</table>
</cfif>

<!--- 12/20/99 sdd for overweight orders --->
<cfif session.overweight is "true">
<table width="95%" border="0">
    <tr align="center">
        <td>
        *Because of the size and/or weight of this order, we will quote shipping cost and shipping methods on e-mail confirmation.</td>
    </tr>
</table>
</cfif>
</cfoutput>
</cfif>

</form>

Я должен пропустить что-то там, что вызывает это больше не отображать, но что это? Кто-нибудь знает? Я просто не могу понять, как он выводится для нескольких выпадающих меню, а не для выпадающего списка «Запрос на предложение».

Может кто-нибудь помочь мне с этим? Спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...