Commits

Allan Davis  committed ccbdf5d

finished donation form and process

  • Participants
  • Parent commits 3b01b16

Comments (0)

Files changed (2)

File pixels/forms.py

     """ Form for donations input from external user """
     name = forms.CharField(max_length=100, required=False)
     email = forms.EmailField(max_length=50, required=False)
-    anonymous = forms.BooleanField()    
+    anonymous = forms.BooleanField(required=False, widget=forms.HiddenInput)    
     amount = forms.DecimalField(max_digits=5, decimal_places=2, widget=forms.HiddenInput)
     pounds = forms.IntegerField(widget=forms.HiddenInput)
     

File templates/checkout.html

 {% block header %}
 <script language="javascript" type="text/javascript">
     function donation(){
-        $("#id_anonymous").attr('checked', false);
+        $("#id_anonymous").attr('value', "False");
         $("#donation_form").submit();
     }
     function anon_donation(){
         $("#id_name").attr("value", "anonymous");
         $("#id_email").attr("value", "");
-        $("#id_anonymous").attr('checked', true);
+        $("#id_anonymous").attr('value', "True");
         $("#donation_form").submit();
     }
     
 {%block content %}
 <div id="middleBar">
 <div id="middleBar_Content">
-<h3>You are donating <span id="poundTotal">{{form.initial['pounds']}}</span> lbs of food worth $<span id="total">{{form.initial['amount']}}</span></h3>
+<h3>You are donating <span id="poundTotal">{{form.initial.pounds}}</span> lbs of food worth $<span id="total">{{form.initial.amount}}</span></h3>
 </div>
 </div>
 <div id="content" >
         <table border="0" width="50%" align="center" >
         {{ form.as_table }}
             <tr>
-                <td align="center"><input type="button" value="Donate" onclick="donation();"/></td>
-                <td align="center"><input type="button" value="Anonymouns Donation" onclick="anon_donation();"/></td>
+                <td align="right"><input type="button" value="Donate" onclick="donation();"/></td>
+                <td align="left"><input type="button" value="Anonymouns Donation" onclick="anon_donation();"/></td>
             </tr>
         </table>
     </form>