DropDownBox messages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tsubasa
    New Member
    • Aug 2008
    • 64

    #1

    DropDownBox messages

    I have a dropdown box with two choices, and below the dropdown box are to textboxes. How can I display information above each box based on a selection from the dropdown box? -Thanks!

    Code:
    <% if showccform="YES" then %>
                <tr>
                  <td width="10%">&nbsp;</td>
                  <td width="80%"><select size="1" name="cctype">
                  <%
                  'Open database get credit card types!
    	          set rs=openrs("SELECT * FROM creditcard ORDER BY name")
    	          if not rs.eof then
    	            rs.movefirst
    	            while not rs.eof
    	            ccname=rs("name")
    	          %>
                  <option class="formfield" value="<%=ccname%>"><%=ccname%>
                  </option>
                  <%
                    rs.movenext
    	            wend
    	          end if
    	          rs.close
    	          set rs=nothing
    	          %>
                  <option class="formfield" selected value="<%=cctype%>"><%=cctype%>
                  </option>
                  </select></td>
                  <td width="10%">&nbsp;</td>
                </tr>
                <tr>
                  <td width="10%" height="21">&nbsp;</td>
                  <td class="formheadings" width="80%" height="21"></td>
                  <td width="10%" height="21">&nbsp;</td>
                </tr>
                <tr>
                  <td width="10%" height="25">&nbsp;</td>
                  <td width="80%" height="25">
                  <input class="formfield" type="text" name="ccardno" size="20" value="<%=ccardno%>"></td>
                  <td width="10%" height="25">&nbsp;</td>
                </tr>
                <tr>
                  <td width="10%" height="21">&nbsp;</td>
                  <td class="formheadings" width="80%" height="21"></td>
                  <td width="10%" height="21">&nbsp;</td>
                </tr>
                <tr>
                  <td width="10%" height="25">&nbsp;</td>
                  <td width="80%" height="25">
                  <input class="formfield" type="text" name="ccnoc" size="20" value="<%=fixhtmlform(ccnoc)%>"></td>
                   <td width="10%" height="25">&nbsp;</td>
                </tr>
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi tsubasa,

    So are you saying that you when a user selects an option from the drop down list a message will appear above the textboxes and what that message says will depend on which option was selected?

    Dr B

    Comment

    • tsubasa
      New Member
      • Aug 2008
      • 64

      #3
      Originally posted by DrBunchman
      Hi tsubasa,

      So are you saying that you when a user selects an option from the drop down list a message will appear above the textboxes and what that message says will depend on which option was selected?

      Dr B
      Yes that is correct. The choices are GCPC or GSA. See below.

      If the pick is GCPC the displays would be AAC above the first box and Acess Code above the 2nd box.

      If the pick is GSA the display would be BarCode above the first box and JON# above the 2nd box.

      Tsu

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Originally posted by tsubasa
        Yes that is correct. The choices are GCPC or GSA. See below.

        If the pick is GCPC the displays would be AAC above the first box and Acess Code above the 2nd box.

        If the pick is GSA the display would be BarCode above the first box and JON# above the 2nd box.

        Tsu
        You would use javascript to call a function on the select's "onchange" event that changes the text of a control at that location.

        I'm moving your thread to the javascript forum.

        Jared

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Since this thread is now in the JavaScript forum, can you post the client-side version of your code (view source in the browser).

          Comment

          • tsubasa
            New Member
            • Aug 2008
            • 64

            #6
            The client side is above.

            -Tsu

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              I can see ASP code in your first post. Nevertheless, have you tried what Jared aka. jhardman suggested above? Add a span or div to contain the messages. In your drop down box onchange call a function which sets these messages by first accessing the containers and then setting their innerHTML property.

              Comment

              • tsubasa
                New Member
                • Aug 2008
                • 64

                #8
                I am still new to webpage programming so bare with me. I have added the drop down list with Div tags. Is this what you mean't, see line 624.
                Code:
                <%
                '************************************************************
                %>
                <!--#include file="../includes/no-cache.asp"-->
                <!--#include file="../includes/setup.asp"-->
                <!--#include file="../includes/functions.asp"-->
                <%
                cartid = Request.Cookies("cartid")
                task=request("task")
                customerid= Request.Cookies("customerid")
                orderid=request.cookies("orderid")
                cctype=request("cctype")
                ccardno=request("ccardno")
                expmonth=request("expmonth")
                expyear=request("expyear")
                cccode=request("cccode")
                ccnoc=request("ccnoc")
                method=request("method")
                paymentdue=request.form("paymentdue")
                
                'Get additional page setup info.
                set rs=openrs("SELECT ccen, pbmen, gatewayen, downen, cvven FROM setup")
                  ccen=rs("ccen")
                  pbmen=rs("pbmen")
                  gatewayen=rs("gatewayen")
                  downen=rs("downen")
                  cvven=rs("cvven")
                closers()
                
                'Get additional page setup info.
                set rs=openrs("SELECT gateway, authcccode, authver, authtest, ppipnen FROM gateway")
                  gatewayname=rs("gateway")
                  authcccode=rs("authcccode")
                  authver=rs("authver")
                  authtest=rs("authtest")
                  ppipnen=rs("ppipnen")
                closers()
                
                'Check to see if order number has been generated, if not send user back to checkout2.asp.
                if orderid="" or isnull(orderid) then
                  pdredirect("checkout2.asp")
                end if
                
                'Get Cart contents
                %>
                <!--#include file="../includes/func-cartlist.asp"-->
                <%
                'Check for Inventory Errors
                if inverror="Y" then
                  pdredirect(shopcarturl)
                end if
                
                if grandtotal>0 then
                  paymentdue="Y"
                end if
                if paymentdue="N" then
                  method="pbm"
                  task="post"
                end if
                
                'If form submitted for Payment Gateway.
                if task="post" and instr(method,"gate")>0 then
                  'Save Pay by Mail information ---------------
                  Set rsmod = Server.CreateObject("ADODB.Recordset")
                  rsmod.Open "Select * From orders WHERE id=" & orderid, DB, 1, 3
                  
                  if instr(method, ":PP:")>0 then gatewayname="PayPal"
                  if instr(method, ":2C:")>0 then gatewayname="2Checkout.com"
                  if instr(method, ":AN:")>0 then gatewayname="Authorize.net"
                  if instr(method, ":PF:")>0 then gatewayname="PayFlow"
                  if instr(method, ":WP:")>0 then gatewayname="WorldPay" 
                  if instr(method, ":LP:")>0 then gatewayname="LinkPoint"  
                  if instr(method, ":CG:")>0 then gatewayname="Payment Gateway"
                    
                  rsmod("cctype") = gatewayname
                  rsmod("ccardno") = rc4("", rc4code)
                  rsmod("ccnoc") = "" 
                  rsmod("cccode") = ""
                  rsmod("expmonth") = ""
                  rsmod("expyear") = ""
                  'Do not Update status if PayPal IPN is used.
                  if ppipnen="ON" and gatewayname="PayPal" then
                  else
                    rsmod("status") = "New"
                  end if
                  rsmod("downen") = downen
                  rsmod("giftamt")=giftamt
                  rsmod.Update
                  rsmod.Close
                  set rsmod=nothing
                
                  'Update Gift Cert.(upon redemption)
                  if ppipnen="ON" and gatewayname="PayPal" then
                  else
                    updategcstatus giftcode 
                  end if    
                  
                  'Save cart details in the orderdetail table.
                  Set rsmod = Server.CreateObject("ADODB.Recordset")
                  rsmod.Open "Select * From orderdetail WHERE cartid='" & cartid & "'", DB, 1, 3
                  if not rsmod.eof then
                    rsmod.movefirst
                    while not rsmod.eof
                    rsmod("orderid") = orderid
                    rsmod("customerid") = customerid
                    'rsmod("cartid") = ""
                    
                    'Update inventory for the item.
                    itemid=rsmod("itemno")
                    qty=rsmod("qty")
                    
                    'Do not Update Inventory if PayPal IPN is used.
                    if ppipnen="ON" and gatewayname="PayPal" then
                    else
                      Set rsinv = Server.CreateObject("ADODB.Recordset")
                      rsinv.Open "Select * From items WHERE id=" & itemid, DB, 1, 3
                      if not rsinv.eof then
                        oldqty=rsinv("qty")
                        newqty=oldqty-qty
                        rsinv("qty")=newqty
                        rsinv.update
                      end if
                      rsinv.close
                      set rsinv=nothing
                    end if
                    
                    'Update Gift Certificate
                    finalizegc orderid, rsmod("giftid")
                    
                      'If item is a digital download, create and save key.
                      if rsmod("digital")="ON" then
                        'Create unique key for Download
                         Randomize
                         temp1 = replace(Time, " ", "")
                         temp1 = replace(temp1, ":", "")
                         temp2 = replace(date, " ", "")
                         temp2 = replace(temp2, "/", "")
                         key = temp2 & temp1 & Int((9999999999- 5 + 1) * Rnd + 5)
                         'Save Key
                         rsmod("digkey")=key
                         rsmod("downloads")=qty
                         rsmod("ip")=request.servervariables("REMOTE_ADDR")       
                      end if  
                          
                    rsmod.Update
                    rsmod.movenext
                    wend
                  end if
                  rsmod.Close
                  set rsmod=nothing
                  
                  'After data is saved, send user to Payment Gateway.
                  if instr(method,":CG:")>0 then
                    pdredirect("gateway_custom.asp")
                  else
                    pdredirect("gateway_out.asp")
                  end if
                end if
                
                
                'If form submitted for Pay by Mail.
                if task="post" and method="pbm" then
                  'Save Pay by Mail information ---------------
                  Set rsmod = Server.CreateObject("ADODB.Recordset")
                  rsmod.Open "Select * From orders WHERE id=" & orderid, DB, 1, 3
                  rsmod("cctype") = getsystext("sys44") 
                  rsmod("ccardno") = rc4("", rc4code)
                  rsmod("ccnoc") = "" 
                  rsmod("jon_number") = ""
                  rsmod("expmonth") = ""
                  rsmod("expyear") = ""
                  rsmod("status") = "New"
                  rsmod("downen") = downen
                  rsmod("giftamt")=giftamt
                  rsmod.Update
                  rsmod.Close
                  set rsmod=nothing
                  
                  'Update Gift Cert.(upon redemption)
                  updategcstatus giftcode 
                  
                  'Save cart details in the orderdetail table.
                  Set rsmod = Server.CreateObject("ADODB.Recordset")
                  rsmod.Open "Select * From orderdetail WHERE cartid='" & cartid & "'", DB, 1, 3
                  if not rsmod.eof then
                    rsmod.movefirst
                    while not rsmod.eof
                    rsmod("orderid") = orderid
                    rsmod("customerid") = customerid
                    'rsmod("cartid") = ""
                    'Update inventory for the item.
                    itemid=rsmod("itemno")
                    qty=rsmod("qty")
                    
                    Set rsinv = Server.CreateObject("ADODB.Recordset")
                    rsinv.Open "Select * From items WHERE id=" & itemid, DB, 1, 3
                      if not rsinv.eof then
                        oldqty=rsinv("qty")
                        newqty=oldqty-qty
                        rsinv("qty")=newqty
                        rsinv.update
                      end if
                    rsinv.close
                    set rsinv=nothing
                    
                    'Update Gift Certificate
                    finalizegc orderid, rsmod("giftid")
                    
                      'If item is a digital download, create and save key.
                      if rsmod("digital")="ON" then
                        'Create unique key for Download
                         Randomize
                         temp1 = replace(Time, " ", "")
                         temp1 = replace(temp1, ":", "")
                         temp2 = replace(date, " ", "")
                         temp2 = replace(temp2, "/", "")
                         key = temp2 & temp1 & Int((9999999999- 5 + 1) * Rnd + 5)
                         'Save Key
                         rsmod("digkey")=key
                         rsmod("downloads")=qty
                         rsmod("ip")=request.servervariables("REMOTE_ADDR")       
                      end if      
                    
                    rsmod.Update
                    rsmod.movenext
                    wend
                  end if
                  rsmod.Close
                  set rsmod=nothing
                  'After completed, send user to order thanks message.
                  if paymentdue="N" then
                    pdredirect("checkout5.asp")
                  else
                    pdredirect("checkout5.asp?method=pbm")
                  end if
                end if
                
                'If form submitted for Credit card payment.
                if task="post" and method="cc" then
                  'Check for Form errors.
                  formerror=""
                  
                  call checkForm(cctype,getsystext("sys47"),"T",1,50)
                  call checkForm(ccardno,getsystext("sys48"),"T",13,13)
                  call checkForm(ccnoc,getsystext("sys58"),"T",11,11)
                      
                  expireson=expmonth & "/" & expyear
                    
                  if authcccode="ON" and gatewayen="ON"  then
                    call checkForm(cccode,getsystext("sys49"),"T",3,5)
                  end if
                  
                     
                    'Update Order with Payment details.
                    Set rsmod = Server.CreateObject("ADODB.Recordset")
                    rsmod.Open "Select * From orders WHERE id=" & orderid, DB, 1, 3
                    rsmod("cctype") = cctype 
                    rsmod("ccardno") = rc4(ccardno, rc4code)
                    rsmod("ccnoc") = ccnoc 
                    rsmod("cccode") = cccode
                    rsmod("status") = "New"
                    rsmod("ccapproval") = ccapproval
                    rsmod("downen") = downen
                	rsmod("giftamt")=giftamt   
                    rsmod.Update
                    rsmod.Close
                    set rsmod=nothing
                    
                    'Update Gift Cert.(upon redemption)
                    updategcstatus giftcode     
                    
                    'Save cart details in the orderdetail table.
                    Set rsmod = Server.CreateObject("ADODB.Recordset")
                    rsmod.Open "Select * From orderdetail WHERE cartid='" & cartid & "'", DB, 1, 3
                    if not rsmod.eof then
                      rsmod.movefirst
                      while not rsmod.eof
                      rsmod("orderid") = orderid
                      rsmod("customerid") = customerid
                      'rsmod("cartid") = ""
                      'Update inventory for the item.
                      itemid=rsmod("stocknumber")
                      qty=rsmod("qty")
                      
                      Set rsinv = Server.CreateObject("ADODB.Recordset")
                      rsinv.Open "Select * From items WHERE id=" & itemid, DB, 1, 3
                      if not rsinv.eof then
                        oldqty=rsinv("qty")
                        newqty=oldqty-qty
                        rsinv("qty")=newqty
                        rsinv.update
                      end if
                      rsinv.close
                      set rsinv=nothing
                      
                      'Update Gift Certificate
                       finalizegc orderid, rsmod("giftid")
                      
                      'If item is a digital download, create and save key.
                      if rsmod("digital")="ON" then
                        'Create unique key for Download
                         Randomize
                         temp1 = replace(Time, " ", "")
                         temp1 = replace(temp1, ":", "")
                         temp2 = replace(date, " ", "")
                         temp2 = replace(temp2, "/", "")
                         key = temp2 & temp1 & Int((9999999999- 5 + 1) * Rnd + 5)
                         'Save Key
                         rsmod("digkey")=key
                         rsmod("downloads")=qty
                         rsmod("ip")=request.servervariables("REMOTE_ADDR")       
                      end if  
                            
                      rsmod.Update
                      rsmod.movenext
                      wend
                    end if
                    rsmod.Close
                    set rsmod=nothing
                    pdredirect("checkout5.asp")
                end if
                
                'Determine which payment choice is checked.
                pbbox=""
                ccbox=""
                if ccen="ON" or instr(gatewayname,":AN:")>0 then 
                  ccbox="checked"
                  pbbox=""
                else
                  pbbox="checked"
                end if
                
                'Check if Payment Gateway is enabled.
                if ccen="ON" or instr(gatewayname,":AN:")>0 then
                  showccform="YES"
                  if instr(gatewayname,":AN:")>0 and authver="SIM" then
                    showccform="NO"
                  end if  
                  if instr(gatewayname,":AN:")>0 and authver="AIM" then
                    showccform="YES"
                    if gatewayen="ON" and authtest="ON" then
                      ccardno="5424000000000015"
                      cctype="Authorize.NET Test"
                      expmonth="10"
                      expyear="2010"
                      ccnoc="Test Name" 
                      cccode="541"
                      testmessage="<span class=errors><br>YOU ARE IN TEST MODE.<BR>The card number below is a test credit card, it is not a valid credit card and it will not be charged.<br></span>"
                    end if
                  end if
                end if 
                
                'Testing
                if demomode="yes" then
                  ccardno="5424000000000015"
                  cctype="MasterCard"
                  cccode="541"
                end if
                
                'Redirect to Waiting Message for Authorize.net Transactions.
                if gatewayen="ON" and instr(gatewayname,":AN:")>0 and authver="AIM" then
                  checkouturl="checkout4a.asp"
                else
                  checkouturl="checkout4.asp"
                end if
                
                zpage=pg9
                %>
                
                <!--#include file="../includes/top.asp"-->
                <% getleftside(zpage)%>    
                 	  <% getsecspace ()%>
                      <%  getHeading "heads7", heads7, "", 2 %>
                      <table border="0" <%=getstyle("heads7")%> cellpadding="5" cellspacing="0" width="100%">
                
                      <form method="POST" action="<%=checkouturl%>" name="form" id="form">
                        </form>
                        <input type="hidden" name="task" value="post">
                        <tr>
                          <td class="messages" width="100%"><%=fixERR(formerror)%></td>
                        </tr>    
                        <tr>
                          <td width="100%">
                          <table class="forms" border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                              <td width="10%" height="10">&nbsp;</td>
                              <td width="80%" height="10">&nbsp;</td>
                              <td width="10%" height="10">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%" height="10">&nbsp;</td>
                              <td class="formheadings" width="80%" height="10"><%=getsystext("sys42")%></td>
                              <td width="10%" height="10">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%" height="10">&nbsp;</td>
                              <td width="80%" height="10">&nbsp;</td>
                              <td width="10%" height="10">&nbsp;</td>
                            </tr>
                
                            <tr>
                              <td width="10%" height="10"></td>
                              <td class="formordertotal" width="80%" height="10">
                              <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber2">
                                <tr>
                                  <td class="formordertotal">&nbsp;&nbsp;<%=showCurr(grandtotal)%></td>
                                  <td class="formordertotal">&nbsp;&nbsp;</td>
                                  <td><% showbutton "butts6", butts6, shopsslurl & "shop/orderreview.asp","" %></td>
                                </tr>
                              </table>
                              </td>
                              <td width="10%" height="10"></td>
                            </tr>    
                            <% if paymentdue="Y" then %>
                            <tr>
                              <td width="10%" height="10">&nbsp;</td>
                              <td  width="80%" height="10"></td>
                              <td width="10%" height="10">&nbsp;</td>
                            </tr>    
                            <tr>
                              <td width="10%" height="10">&nbsp;</td>
                              <td class="formheadings" width="80%" height="10"><%=getsystext("sys43")%><br>
                              <br>
                              </td>
                              <td width="10%" height="10">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%" align="right" height="10">&nbsp;</td>
                              <td width="80%">
                              
                              <% if pbmen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" value="pbm" <%=pbbox%> name="method"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys44")%></td>
                                </tr>
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr>   
                              </table>
                              <% end if %>
                
                              <% if instr(gatewayname,":PP:")>0 and gatewayen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="gate:PP:"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys45")%></td>
                                </tr>
                              </table>              
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"><img border="0" src="img/pplogo.gif"></td>
                                </tr>
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr>                
                              </table>
                              <% end if %>
                              <% if instr(gatewayname,":2C:")>0 and gatewayen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="gate:2C:"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys53")%></td>
                                </tr>
                              </table>             
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"><img border="0" src="img/2checkoutlogo.gif"></td>
                                </tr>
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr>                
                                
                                
                              </table>
                              <% end if %>
                              <% if instr(gatewayname,":AN:")>0 and authver="SIM" and gatewayen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" class="formheadings">&nbsp;</td>
                                </tr>
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="gate:AN:"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys54")%></td>
                                </tr>                
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"><img border="0" src="img/authnetlogo.gif"></td>
                                </tr>
                                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr>
                                
                              </table>
                              <% end if %>
                              
                              <% if instr(gatewayname,":PF:")>0 and gatewayen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" class="formheadings">&nbsp;</td>
                                </tr>
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="gate:PF:"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys55")%></td>
                                </tr>                
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"><img border="0" src="img/logo_verisign.gif"></td>
                                </tr>
                                               <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr> 
                                
                              </table>
                              <% end if %>
                              
                              
                               <% if instr(gatewayname,":WP:")>0 and gatewayen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" class="formheadings">&nbsp;</td>
                                </tr>
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="gate:WP:"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys56")%></td>
                                </tr>                
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"><img border="0" src="img/worldpay-logo.gif"></td>
                                </tr>
                                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr>
                        
                              </table>
                              <% end if %>  
                              <% if instr(gatewayname,":LP:")>0 and gatewayen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="gate:LP:"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys57")%></td>
                                </tr>
                              </table>             
                             <!-- <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"><img border="0" src="img/none.gif"></td>
                                </tr>
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr>                
                                
                                
                              </table>-->
                              <% end if %>
                              <% if instr(gatewayname,":CG:")>0 and gatewayen="ON" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="gate:CG:"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys116")%></td>
                                </tr>
                              </table>             
                             <!-- <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"><img border="0" src="img/none.gif"></td>
                                </tr>
                                <tr>
                                  <td width="7%" class="formheadings">&nbsp;</td>
                                  <td width="93%" align="left"></td>
                                </tr>                
                                
                                
                              </table>-->
                              <% end if %>              
                
                              
                
                
                              
                               <% if showccform="YES" then %>
                              <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
                
                                <tr>
                                  <td width="7%" valign="top">
                                  <input class="formbox" type="radio" name="method" <%=ccbox %> value="cc"></td>
                                  <td class="formheadings" width="93%"><%=getsystext("sys46")%></td>
                                </tr>                
                              </table>
                              <% end if %>               
                              
                              </td>
                              <td width="10%" height="10">&nbsp;</td>
                            </tr>
                            <% if showccform="YES" then %>
                            <tr>
                              <td width="10%" height="21">&nbsp;</td>
                              <td class="formheadings" width="80%" height="21"><%=getsystext("sys47")%></td>
                              <td width="10%" height="21">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%"></td>
                              <td width="80%">
                              <div align="left">
                			  <select name="cctype">
                			  <option>GSA Card</option>
                			  <option>GCPC Card</option>
                			  </select></div>
                		   </tr>
                            <tr>
                              <td width="10%" height="21">&nbsp;</td>
                              <td class="formheadings" width="80%" height="21"><%=getsystext("sys48")%></td>
                              <td width="10%" height="21">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%" height="25">&nbsp;</td>
                              <td width="80%" height="25">
                              <input class="formfield" type="text" name="ccardno" size="20" value="<%=ccardno%>"></td>
                              <td width="10%" height="25">&nbsp;</td>
                            </tr>
                            <% if authcccode="ON" or cvven="ON" then %>
                            <tr>
                              <td width="10%" height="21">&nbsp;</td>
                              <td class="formheadings" width="80%" height="21"><%=getsystext("sys49")%></td>
                              <td width="10%" height="21">&nbsp;</td>
                            </tr>
                            <% end if %>
                            <tr>
                              <td width="10%" height="21">&nbsp;</td>
                              <td class="formheadings" width="80%" height="21"><%=getsystext("sys58")%></td>
                              <td width="10%" height="21">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%" height="25">&nbsp;</td>
                              <td width="80%" height="25">
                              <input class="formfield" type="text" name="ccnoc" size="20" value="<%=fixhtmlform(ccnoc)%>"></td>
                              <td width="10%" height="25">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%" height="21">&nbsp;</td>
                              <td width="80%" height="21">&nbsp;</td>
                              <td width="10%" height="21">&nbsp;</td>
                            </tr>
                            <% end if %>
                            <%else%>
                            <input type="hidden" name="paymentdue" value="N">
                            <tr>
                              <td width="10%" height="21">&nbsp;</td>
                              <td width="80%" height="21">&nbsp;</td>
                              <td width="10%" height="21">&nbsp;</td>
                            </tr>
                            <% end if %>
                            <tr>
                              <td width="10%">&nbsp;</td>
                              <td width="80%" height="10">&nbsp;</td>
                              <td width="10%">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%">&nbsp;</td>
                              <td width="80%" align="center"><% showbutton "butts14",butts14,"","form" %></td>
                              <td width="10%">&nbsp;</td>
                            </tr>
                            <tr>
                              <td width="10%">&nbsp;</td>
                              <td width="80%" align="center" height="20">&nbsp;</td>
                              <td width="10%">&nbsp;</td>
                            </tr>
                            <% if hidebancorn=0 or isnull(hidebancorn) then %>
                            <tr>
                              <td width="10%" valign="bottom" align="left"><img border="0" src="img/bot_lolef.gif" width="15" height="15"></td>
                              <td width="80%" align="center" height="10">&nbsp;</td>
                              <td width="10%" valign="bottom"  align="right"><img border="0" src="img/bot_lorig.gif" width="15" height="15"></td>
                            </tr>
                            <% end if %>
                          </table>
                          </td>
                        </tr>
                      <tr>
                        <td width="100%" height="20"></td>
                      </tr>      
                      </form>
                    </table>
                
                <% getrightside(zpage)%><!--#include file="../includes/bottom.asp"-->

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  No, the div(s) should be just for the text that needs to be displayed/changed above the text boxes, so the div should be where you want the text messages to appear.

                  Then add an onchange event to the drop down box passing the value to the function:
                  Code:
                  <select ... onchange="changeText(this.value)">

                  Comment

                  • tsubasa
                    New Member
                    • Aug 2008
                    • 64

                    #10
                    You completely lost me. Here is what I will do. I will put back the original code for the ASP dropdown list and the textboxes. Understand that I am new to JavaSript so you will need to explain somethings with examples.

                    -Tsu

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      OK, I didn't realise. I haven't got time now, but I should have something for you later unless someone else can jump in before then.

                      Comment

                      • tsubasa
                        New Member
                        • Aug 2008
                        • 64

                        #12
                        If you can come up with something, cool! If not its no big deal. I can always make a few extra pages and just drive the user into the selection.

                        -Tsu

                        Comment

                        • acoder
                          Recognized Expert MVP
                          • Nov 2006
                          • 16032

                          #13
                          Where's the input boxes that need to have the messages above them?

                          1. Above those boxes, add a div:
                          Code:
                          <div id="msgdiv"></div>
                          ...
                          <div id="msgdiv2"></div>
                          2. Add the onchange to the select on line 624/5 passing the selected value to a function:
                          Code:
                          <select name="cctype" onchange="changeMsg(this.value);">
                          3. Now define the function in script tags:
                          Code:
                          function changeMsg(val) {
                              // if the selected value equals the first value...
                              if (val == "...") { // change ... to whatever value you want to compare against
                                  // set text in first div
                                  document.getElementById("msgdiv").innerHTML = 'whatever';
                                  // set text in second div
                                  document.getElementById("msgdiv2").innerHTML = 'something else';
                              } else {
                                  // repeat as above for the second set of message...
                              }
                          }

                          Comment

                          • tsubasa
                            New Member
                            • Aug 2008
                            • 64

                            #14
                            Ok, let me give this a try.

                            Comment

                            Working...