Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2004, 09:29 AM
Registered User
 
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vijay,
      I sincerely appreciate your efforts! And perhaps I'm just having troubles explaining myself. Could you please evaluate the following code and confirm that the syntax is correct. If so, I'll go back and look at other possible causes for this not working.

<%


Select Case (varPaymentType)

    Case "Check"
    Response.Write"<p>You have chosen to pay by check.</p>"


    Case "Cash"
    Response.Write"You have chosen to pay by cash. <br>"

    Case "PayPal"
    Response.Write"You have chosen to pay by credit card. Please click on the link below to pay securely via PayPal."

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
         <input type="hidden" name="cmd" value="_xclick">
          <input type="hidden" name="business" value="[email protected]">
          <input type="hidden" name="item_name" value="<%=Request("EName")%>">
          <input type="hidden" name="amount" value="<%=strTotal%>">
      <p>
      <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
      </p>
    </form>

End Select
%>

Many thanks,
Jon

 
Old October 20th, 2004, 10:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

As I said in a couple of posts earlier(Check my SECOND post on this Thread), you are still missing the ASP tags there. That is causing the problem.
Code:
<%
Select Case (varPaymentType)

    Case "Check"
    Response.Write"<p>You have chosen to pay by check.</p>"

    Case "Cash"
    Response.Write"You have chosen to pay by cash. <br>"

    Case "PayPal"
    Response.Write"You have chosen to pay by credit card. Please click on the link below to pay securely via PayPal."
%>
<!-- as the following lines are HTML codes, you have to close the ASP 
tag before this and Open again as shown below, before END SELECT -->
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
         <input type="hidden" name="cmd" value="_xclick">
          <input type="hidden" name="business" value="[email protected]">
          <input type="hidden" name="item_name" value="<%=Request("EName")%>">
          <input type="hidden" name="amount" value="<%=strTotal%>">
      <p>
      <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
      </p>
    </form>
<%
End Select
%>
OR the other way of doing this is, using RESPONSE.WRITE.
Code:
<%
Select Case (varPaymentType)

    Case "Check"
    Response.Write"<p>You have chosen to pay by check.</p>"

    Case "Cash"
    Response.Write"You have chosen to pay by cash. <br>"

    Case "PayPal"
    Response.Write"You have chosen to pay by credit card. Please click on the link below to pay securely via PayPal."


    Response.write "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>"
        Response.write "<input type='hidden' name='cmd' value='_xclick'>"
        Response.write "<input type='hidden' name='business' value='[email protected]'>"
        Response.write "<input type='hidden' name='item_name' value='<%=Request("EName")%>'>"
        Response.write "<input type='hidden' name='amount' value='<%=strTotal%>'>"
    Response.write "<p>"
    Response.write "<input type='image' src='https://www.paypal.com/en_US/i/btn/x-click-butcc.gif' border='0' name='submit' alt='Make payments with PayPal - it's fast, free and secure!'>"
    Response.write "</p>"
    Response.write"</form>"
End Select
%>
Hope that explains.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 21st, 2004, 12:33 AM
Registered User
 
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vijay - You're a jet!!! It works fine now. Many thanks.

Jon






Similar Threads
Thread Thread Starter Forum Replies Last Post
Using IS in Select Case mega Pro VB 6 4 August 22nd, 2005 08:40 AM
Select Case junaidraja30 Access VBA 1 February 5th, 2005 08:30 PM
select case yuvalk SQL Server 2000 4 August 25th, 2004 02:33 PM
Select Case morpheus VB How-To 1 August 13th, 2003 09:14 AM
Select Case andy24 Classic ASP Databases 5 July 25th, 2003 07:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.