PayPal Form will not submit

Mar 28, 2010 at 7:20 PM

Below is the code for the page.  All works except it will not submit the form data to paypal.  Nothing happens.

What am I doing wrong?

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="error_occurred" %>
<%@ Import Namespace="BlogEngine.Core" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">
<SCRIPT>
function open_window(url) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=550,height=750');
}
</SCRIPT>
  <div>
    <h2>Join Us</h2>
    
    <div>
    Complete the printable form and return with your check to:<br />
        <a href="javascript:open_window('form.html')"><em><strong>Click 
          here to view and print the membership form.</strong></em></a> 
        <br />
        <br />
      
      <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="myform" target=_blank>
            <input type="hidden" name="cmd" value="_s-xclick">
            <input type="hidden" name="hosted_button_id" value="5670100">
            <input type="hidden" name="on0" value="Membership Options"><label>Membership Options</label>
            <select name="os0">
              <option value="-" selected="selected">Please Select...</option>
              <option value="Active Voting">Active Voting $40.00 </option>
              <option value="Individual Sustaining">Individual Sustaining $50.00 </option>
              <option value="Institutional Sustaining">Institutional Sustaining $100.00 </option>
            </select><span>*Required
            </span>
            <br /><br />
            <input type="hidden" name="on1" value="Your Name/Company" size="60">
            <label>Your Name/Company</label>
            <input type="text" name="os1" maxlength="60" size="30"/><span>*Required
                  </span>
            <input type="hidden" name="currency_code" value="USD" >
            <br /><br />
            <input type="image" src="pics/joinbutton.jpg" border="0" name="submit"  
                      alt="PayPal - The safer, easier way to pay online!">  Please note: you will be forwarded to PayPal.</span>
             <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form>
    </div>
     
    
  </div>
</asp:Content>

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="error_occurred" %>

<%@ Import Namespace="BlogEngine.Core" %>

 

 

<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">

<SCRIPT>

 

function open_window(url) {

mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=550,height=750');

}

 

</SCRIPT>

  <div class="post">

    <h2>Join Us</h2>

 

    <div>

    Complete the printable form and return with your check to:<br />

        <a href="javascript:open_window('form.html')"><em><strong>Click 

          here to view and print the membership form.</strong></em></a> 

        <br />

        <br />

 

      <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="myform" target=_blank>

            <input type="hidden" name="cmd" value="_s-xclick">

            <input type="hidden" name="hosted_button_id" value="5670100">

            <input type="hidden" name="on0" value="Membership Options"><label>Membership Options</label>

 

            <select name="os0">

              <option value="-" selected="selected">Please Select...</option>

              <option value="Active Voting">Active Voting $40.00 </option>

              <option value="Individual Sustaining">Individual Sustaining $50.00 </option>

              <option value="Institutional Sustaining">Institutional Sustaining $100.00 </option>

            </select><span class="style1">*Required

            </span>

            <br /><br />

            <input type="hidden" name="on1" value="Your Name/Company" size="60">

 

            <label>Your Name/Company</label>

 

            <input type="text" name="os1" maxlength="60" size="30"/><span class="style1">*Required

                  </span>

            <input type="hidden" name="currency_code" value="USD" >

            <br /><br />

            <input type="image" src="pics/joinbutton.jpg" border="0" name="submit"  

                      alt="PayPal - The safer, easier way to pay online!">  Please note: you will be forwarded to PayPal.</span>

             <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 

</form>

 

    </div>

 

 

  </div>

</asp:Content>

 

Coordinator
Mar 28, 2010 at 10:51 PM

You can Google for "paypal blogengine".  Some people have posted/blogged about solutions.

One problem is that the standard ContentPlaceHolder in the master page is already wrapped in a <form> tag.  When you put your own <form> tag in the content page, you now have a nested <form> tag, which is illegal in terms of HTML rules.  This alone is probably causing the problem.

You might find some solutions Googling.  Another option is an iframe.  A while back, I also wrote a blog post on using a second ContentPlaceHolder to work around the nested <form> problem.

Mar 29, 2010 at 8:17 PM

We use PayPal on our hiking club website which is BE 1.6 without any issues but the PayPal form is on the PayPal website and has nothing to do with BlogEngine.  We get new members paying everyday without any problems.