Solved

ajax passing fields in twice

Posted on 2013-11-04
19
409 Views
Last Modified: 2013-11-09
I have a simple form that I am using ajax to send the information back to my database.
function submitCart () {
$.post(
     "scripts/savecart.asp",
     $("#form1").serialize()
);}

Open in new window

For some strange reason it is sending all the fields on the page twice.
I see this in the post parameters:

item28=0&item29=0&item30=0&item28=0&item29=0&item30=0

then it's causing my database to error out, since I am not getting int, but '0,0' for each field.
I searched in my page source code and I only see the field once there.

Any idea what might be wrong on the page?
0
Comment
Question by:rivkamak
  • 8
  • 7
  • 3
  • +1
19 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
Can you post the code from your form please.  It looks like you have multiple names or you have multiple forms with the same id.  Just post the complete code to your page (minus any passwords).
0
 

Author Comment

by:rivkamak
Comment Utility
div class="wrapper">
 
<script>
  var totalCost = 60 ;
  var  totalTickets = 14 ;
 var amtInCart = 14;
 

</script>

<script type="text/javascript" src="scripts/orderScripts.js"></script>

<script type="text/javascript" src="scripts/checkout.js"></script>
 <form action="/checkout.asp" method="post" name="form1" id="form1" onSubmit="return FrontPage_Form1_Validator(this)">
  <div class="container">
    
        
        <div class="page-heading">
        
       

            <h2>Check out Number: 736658099080623 & Place your order</h2>
        </div>
        <div class="checkout-wrapper">
            
                <div class="checkout-breadcrumb">
                    <ul>
                    <li class="first " ><h3><a href="#" data-id="review" data-slide-index="0"><span>1</span> Review Cart &gt;&gt;&gt;</a></h3></li>
                    <li class="second " ><h3><a href="#" data-slide-index="1"><span>2</span> Choose Free Gifts &gt;&gt;&gt;</a></h3></li>
                    <li class="third"><h3><a href="#" data-slide-index="2" ><span>3</span> Payment Info </a></h3></li>
                </ul>

                </div>
                     <div class="checkout-step-wrapper">
                <div class="step1 checkout-step review">
                <div class="checkout-step-content">
                    
                      
               <span id="upsellmessage" style="visibility:hidden"></span> <span id="calculatorString" style="visibility:hidden"></span>    
                    <ul class="item-ul">
                        <li class="header-li">
                            <div class="ticket">Your Tickets:</div>
                            <div class="price">Price:</div>
                            <div class="amount">Amount:</div>

                        </li>
                        
                         
                        <li id ="liList1">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/1.jpg" width="58" height= "48" />
                                </div>
                                <div class="name"> 1. Eretz Yisroel</div>
                            </div>
               
                            <div class="amount">
                                <input type="text" value="10" size="5" readonly  name="item1" id="prz1EretzYisroel"  onChange="calculate('1', 'Eretz Yisroel', this.value,'prz1EretzYisroel');submitCart();"  />
                               <div class="invisible" id="button1"> 
                               <button type="button" onClick="submitCart();CancelItem('1','prz1EretzYisroel' );return false;">Save</button>
                               <button type="button" class="cancel" onClick="CancelItem('1','prz1EretzYisroel' );return false;">Cancel</button></div>
                             <a href="#" id="edit1" onClick="EditItem('1','prz1EretzYisroel' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onClick="removeItem('1','prz1EretzYisroel');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
                        <li id ="liList2">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/2.jpg" width="58" height= "48" />
                                </div>
                                <div class="name"> 2. Rent & Mortgage</div>
                            </div>
               
                            <div class="amount">
                                <input type="text" value="3" size="5" readonly  name="item2" id="prz2RentAndMortgage"  onChange="calculate('2', 'Rent & Mortgage', this.value,'prz2RentAndMortgage');submitCart();"  />
                               <div class="invisible" id="button2"> 
                               <button type="button" onClick="submitCart();CancelItem('2','prz2RentAndMortgage' );return false;">Save</button>
                               <button type="button" class="cancel" onClick="CancelItem('2','prz2RentAndMortgage' );return false;">Cancel</button></div>
                             <a href="#" id="edit2" onClick="EditItem('2','prz2RentAndMortgage' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onClick="removeItem('2','prz2RentAndMortgage');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
                        <li id ="liList3">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/3.jpg" width="58" height= "48" />
                                </div>
                                <div class="name"> 3. Hi Tech</div>
                            </div>
               
                            <div class="amount">
                                <input type="text" value="1" size="5" readonly  name="item3" id="prz3HiTech"  onChange="calculate('3', 'Hi Tech', this.value,'prz3HiTech');submitCart();"  />
                               <div class="invisible" id="button3"> 
                               <button type="button" onClick="submitCart();CancelItem('3','prz3HiTech' );return false;">Save</button>
                               <button type="button" class="cancel" onClick="CancelItem('3','prz3HiTech' );return false;">Cancel</button></div>
                             <a href="#" id="edit3" onClick="EditItem('3','prz3HiTech' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onClick="removeItem('3','prz3HiTech');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
        	<input type="hidden" value="0" size="5" readonly  name="item4" id="prz4DiamondNecklace"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item5" id="prz5GroceryGiveaway"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item6" id="prz6VisaGIftCard"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item7" id="prz7ThreeSheitels"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item8" id="prz8YourWheels"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item9" id="prz9MysteryPrize"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item10" id="prz10Tuition"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item11" id="prz11Outerspace"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item12" id="prz12DiningDecor"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item13" id="prz13Cash"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item14" id="prz14SukkosInIsrael"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item15" id="prz15FillErUp"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item16" id="prz16Lishmah"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item17" id="prz17Leichter"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item18" id="prz18VacationAnywhere"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item19" id="prz19FiveLaptops"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item20" id="prz20DebtFree"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item21" id="prz21FiveishMobile"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item22" id="prz22ShoppingSpree"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item23" id="prz23ClassicJewelry"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item24" id="prz24PricelessBrocha"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item25" id="prz25MakeAWish"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item26" id="prz26CustomSheitel"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item27" id="prz27SavingsBond"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item28" id="prz28Artscroll"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item29" id="prz29AmazonGiftCard"    /> 
	
        	<input type="hidden" value="0" size="5" readonly  name="item30" id="prz30Jackpot"    /> 
	

 
                    </ul>
                    <div class="summary"><span id="totalcost2" style="visibility:hidden;">0</span>
                        <table>
                            <tr>
                                <td class="label">Order Total:  </td>
                                <td class="figure">$<span id="totalcost">60</span></td>
                            </tr>
                            <tr>
                                <td>Tickets: </td>
                                <td><span id="totalTickets">12<br>
You got 2 free tickets.</span><span id="freeTicketString"></span> </td>
                            </tr>
                            <tr>
                                <td>Free Gifts: </td>
                                <td><span id="freegiftamt">0</span></td>
                            </tr>
                            <tr class="red">
                                <td>Million Dollar Raffle  </td>
                                <td>$<span id="winamount">60,000.00</strong> (60*1000) </span></td>
                            </tr>


                        </table>

                    </div>

                </div>
                <div class="button-set">
                 <a href="prizes.asp">      <button class="continue yellow"  type="button">
  <span>                   Continue Shopping &gt;</span>
                    </button></a>
                    <button class="next" data-id="choose-gift" type="button">
                        <span>next &gt;</span>
                    </button>
                </div>
            </div>
            <div class="step2 hid checkout-step choose-gift">
          
 <div class="checkout-step-content">
 
                    <div class="header">
                        <h3>Choose Your Gifts</h3>
                    </div>
                    <p>2013 Shmorg: Your eligible for <span id="actCdStr">2 CD</span>. Which one would  you like?</p>
                    <ul class="cd-list">
                        <li>
                            <span>Shmorg Tales Fiveish Musical Audio Story!</span>
                            <select name="cd1" id="cd1" >
                    <option value="0" selected="selected">0</option>
                    <option value="1">1</option> 
                  </select>
                        </li>
                    
                    </ul>
                      <!-- end free gifts over 250)-->
                   
                  
               <div class="button-set">
                        <button class="back yellow" type="button">
                            <span>back &gt;</span>
                        </button>
                        <button class="next" data-id="payment-info" type="button" onClick=" checkShmorg();">
                            <span>next &gt;</span>
                        </button>
                    </div>
                </div>
               </div>
               
          
        <div class="step3 checkout-step payment-info">
   
            <div class="checkout-step-content">
                <div class="header">
                    <h3>Enter your Payment info</h3>
                </div>
               
                    <fieldset>
                <div class="billing-info">
                    <h4>Billing info</h4>

                            <ul>
                                <li class="fields">
                                    <label>Country</label>
                                    <div class="input-box">
                                        <select name="ccf_country" onchange="BuildModels(this.selectedIndex);">
      <option value="UNITED STATES" selected="selected">UNITED STATES</option>
      <option value="CANADA">CANADA</option>
     
      <option value="">
        
        </option>
    </select>
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Title</label>
                                    <div class="input-box">
                                       <select name="ccf_title" id="ccf_title" >
      <option value="" selected="selected">
        
        </option>
      <option value="Mr.">Mr.</option>
      <option value="Mrs.">Mrs.</option>
      <option value="Ms.">Ms.</option>
      <option value="Rabbi">Rabbi</option>
    </select>
                                    </div>
                                </li>
                                  <li class="fields">
                                    <label>First name</label>
                                    <div class="input-box">
                                       <input name="ccf_FirstName" type="text" id="ccf_FirstName" class="F-name" value="" />
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Last name</label>
                                    <div class="input-box">
                                     <input name="ccf_LastName" type="text" id="ccf_LastName"  class="l-name" value="" />
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Address &amp; apt</label>
                                    <div class="input-box">
                                        <input name="ccf_Address" class="address" type="text" id="ccf_Address" value="" />
                                    </div>
                                </li>
                             
                                <li class="fields">
                                    <label>Donor Number</label>
                                    <div class="input-box">
                                   <input name="ccf_donornumber" type="number" id="ccf_donornumber" value="" maxlength="7" />
                                     <br />
You can find your donor number on the back cover of your auction book.
                                    </div>
                                </li>
                            </ul>

                </div>
                <div class="card-info">
                    <h4>Card info</h4>
                    <ul>
                        <li class="fields">
                            <label>Card Type</label>
                            <div class="input-box">
                               <select name="ccf_CreditCard" id="ccf_CreditCard">
      <option value=""  class="card-type" selected="selected">
        
        </option>
      <option value="Visa">Visa</option>
      <option value="MasterCard">MasterCard</option>
      <option value="Discover">Discover</option>
      <option value="Amex">Amex</option>
      <option value="IsraCard">IsraCard</option>
      <option value="DinersClub">Diners</option>
    </select>
                            </div>
                        </li>
                       
                    </ul>
                    <br /><div id="taxmessage">Tax receipts will be for US taxes unless otherwise selected. Oorah
      takes no responsibility for incorrect selections.</div>
                </div>
                <div class="button-set">
                    <div class="info">
                        Your credit card
            will be charged after you place your order. <strong>Wait
            for the confirmation screen to show that your order
            has been submitted,</strong> it might take a few moments,
            so please be patient to ensure your card does not get
            charged twice. 
                    </div>
                  <button class="place-order" type="submit" >
                        <span>Place order &gt;</span>
                    </button>
                </div>
                </fieldset>
                <input type="hidden" id="pageName" name="pageName" value="cart" />
       <input type="hidden" name="MM_insert" value="FrontPage_Form1" />
    <input type="hidden" name="sessionVar" value="736658099080623" />

    <input name="donation" id="donation" type="hidden" value="60-14" />

<input name="howmanyoveramt" type="hidden" value="" id="howmanyoveramt" />
<input type="hidden" name="orderFormTotal" id="orderFormTotal" value= "60" />
                          <input name="amtInCartValue" type="hidden" id="amtInCartValue" value="0" />
  <input name="packageTickets" type="hidden" id="packageTickets" value="0" />
  <input name="realTicketsBox" type="hidden" id="realTicketsBox" value="12" />
  <input name="FreeTicketsBox" type="hidden" id="FreeTicketsBox" value="2" />
  <input name="totalChargeBox" type="hidden" id="totalChargeBox" value="60" />
    <input name="packageSelected" type="hidden" id="packageSelected" value="0" />

                </div>
            </div>
        </div>
        </div>
          
        </div></form>

Open in new window

0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 250 total points
Comment Utility
your page is maybe marlformed
test your page here : http://validator.w3.org/
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
+1 for what leakim said.  Also try setting up your ajax like below using preventDefault.  Since you are going to the next page, you could also just leave out the ajax and post directly to your /checkout.asp page.

jQuery(function($) {
    $('#form1').on('submit', function(event) {
        var $form = $(this);

 
        $.ajax({
            type: $form.attr('method'),
            url: $form.attr('action'),
            data: $form.serialize(),
 
            success: function(data, status) {
                window.location.replace('/somenewpage.asp');
            }
        });
 
        event.preventDefault();
    });
});

Open in new window

0
 

Author Comment

by:rivkamak
Comment Utility
#1. i validated my page and it didn't bring up anything significant that would affect the ajax.
#2. i am not just posting to the next page. Everytime someone updates thier cart, I need the ajax to get sent.

anything else might be a problem?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
Did  you try the code I posted.  If that does not work,  just as a test post directly to the form to see if it works.  You did not post all of your code but from taking your form and posting it to a page that simply collects the post using

<%=request.form%>

I can see the the data is not duplicated and posting directly works based only on the form code you provided.   Try adding the preventDefault as shown.  Otherwise, errors in your code such as those found in the validator can effect javascript functions.
0
 

Author Comment

by:rivkamak
Comment Utility
I was able to narrow it down to something that might have to do with a 'bxslider'.
When I took out that div that was sliding, I only got 1 post.
Any ideas?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
I didn't see anything with bxslider in your code.  If that is what was creating a duplicate field names, then that sounds right. Like I said from the start, somehow you are posting duplicate field names.  It was nothing in your original code or the updated code you posted that I could see.  You must have more code you did not show.  The important thing is it sounds like you have found the issue.  Now to fix, if you have some type of slider that is creating duplicate field names it is going to cause an issue.  

There are a couple of options for you.  If people are selecting prz4DiamondNecklace in 2 different slides for instance and both are actually the same thing and they meant to pick 2, you can treat each insert as an array and do multiple inserts.  However, that does not sound like the best solution.  You can still treat the input as an array, but just take the first like:

prz4DiamondNecklace=""
if request.form("item4")<>"" then
     arrayPrz4DiamondNecklace=split(request.form("item4"),",")
    prz4DiamondNecklace=arrayPrz4DiamondNecklace(0)
    ' now make sure we have good data
    if not isnumeric(prz4DiamondNecklace) then
          prz4DiamondNecklace=0 ' make it zero since it was bad data
    end if
end if

Open in new window

I still don't like this method either but it good be a quick fix.   The best thing would be to use just one input field and that may have to do with your html mark up.
0
 

Author Comment

by:rivkamak
Comment Utility
I just realized when I go to the page source, I did not get the real code.
When I looked at the html in firefox I got the correct code.

Yes, the bxslider duplicated all my divs and  I have each one twice on the page in source code right now.
I understand your fix , and I'm not 100% sure I would be able to implement it on all my long lines of code.
Is there any other way to get around this bxslider duplicating the divs?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
I think I have several suggestions where the first 2 involve using an array.  If you don't want to recode, that would be the trick.  The question is, which value will be correct?  However, your hidden value's are all zero.  IF that is the case, why even bother inserting zeros.  Just make zero a default value in your db for each of those fields.
0
 

Author Comment

by:rivkamak
Comment Utility
Forget about my duplicate posts for now.
Is it neccesary for the bxslider to double my divs?
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 250 total points
Comment Utility
I don't know what it is or how it is used since you did not post all of your code.  But a slider typically will take multiple div's inside a main div and present them one by one.  If you have this set up wrong, it also means you have duplicate ID's as in two     <input type="hidden" value="0" size="5" readonly  name="item9" id="prz9MysteryPrize"    /> which would be another thing not validating.  Going back to leakim971's suggestion, get your code to validate and most of your problems will go away.

If you are trying to make a wizard, you can instead of updating the db with each step, collect the data into an array and at the very end submit the array of data to your db.  Or you can use jquery ajax to only submit the fields you want and not the entire form.  Using the first example http://api.jquery.com/jQuery.ajax/
$.ajax({
  type: "POST",
  url: "some.php",
  data: { name: "John", location: "Boston" }
})
  .done(function( msg ) {
    alert( "Data Saved: " + msg );
  });

Open in new window


Except instead of "john" or "boston" you could use
var item4= $('#prz4DiamondNecklace').val();
var item5= $('#prz5GroceryGiveaway').val();

$.ajax({
  type: "POST",
  url: "some.php",
  data: { name:item4, location: item5 }
})
  .done(function( msg ) {
    alert( "Data Saved: " + msg );
  });

Open in new window

0
 

Author Comment

by:rivkamak
Comment Utility
I have tons of code on my page. It's not just this 1 post that is being affected.
Is there something I can do to automatically apply this to all my code.
My ajax posts 50 fields. I am not going and mnually typing each line on it's on.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
ok, for about the 3rd or 4th time...post your code. I have to sign off now, and hopefully somebody else can take over or I can come back to it at a later time.
0
 

Author Comment

by:rivkamak
Comment Utility
Here is my code and the real page:
function getRadioValue (radioButtonOrGroup) {
  var value = null;
  if (radioButtonOrGroup.length) { // group 
    for (var b = 0; b < radioButtonOrGroup.length; b++)
      if (radioButtonOrGroup[b].checked)
        value = radioButtonOrGroup[b].value;
  }
  else if (radioButtonOrGroup.checked)
    value = radioButtonOrGroup.value;
  return value;
}

var numberPrizesRemaing = 0 

function calculatePrizes() {
A =  document.form1.prz1EretzYisroel.value
B =  document.form1.prz2RentAndMortgage.value
C =  document.form1.prz3HiTech.value
D =  document.form1.prz4DiamondNecklace.value
E =  document.form1.prz5GroceryGiveaway.value
F =  document.form1.prz6VisaGIftCard.value
G =  document.form1.prz7ThreeSheitels.value
H =  document.form1.prz8YourWheels.value
I =  document.form1.prz9MysteryPrize.value
J =  document.form1.prz10Tuition.value
K =  document.form1.prz11Outerspace.value
L =  document.form1.prz12DiningDecor.value
M =  document.form1.prz13Cash.value
N =  document.form1.prz14SukkosInIsrael.value
O =  document.form1.prz15FillErUp.value
P =  document.form1.prz16Lishmah.value
Q =  document.form1.prz17Leichter.value
R =  document.form1.prz18VacationAnywhere.value
S =  document.form1.prz19FiveLaptops.value
T =  document.form1.prz20DebtFree.value
U =  document.form1.prz21FiveishMobile.value
V =  document.form1.prz22ShoppingSpree.value
W =  document.form1.prz23ClassicJewelry.value
X =  document.form1.prz24PricelessBrocha.value
Y =  document.form1.prz25MakeAWish.value
Z =  document.form1.prz26CustomSheitel.value
AB =  document.form1.prz27SavingsBond.value
AC =  document.form1.prz28Artscroll.value
AD =  document.form1.prz29AmazonGiftCard.value
AE =  document.form1.prz30Jackpot.value

A = Number(A)
B = Number(B)
C = Number(C)
D = Number(D)
E = Number(E)
F = Number(F)
G = Number(G)
H = Number(H)
I = Number(I)
J = Number(J)
K = Number(K)
L = Number(L)
M = Number(M)
N = Number(N)
O = Number(O)
P = Number(P)
Q = Number(Q)
R = Number(R)
S = Number(S)
T = Number(T)
U = Number(U)
V = Number(V)
W = Number(W)
X = Number(X)
Y = Number(Y)
Z = Number(Z)
AB = Number(AB)
AC = Number(AC)
AD = Number(AD)
AE = Number(AE)



numberPrizesChosen = 0;
numberPrizesChosen = ( A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + AB + AC + AD + AE )


return numberPrizesChosen ;
}
	
	function maskKeyPress(objEvent) 
	{
	  var iKeyCode;  	
	  iKeyCode = objEvent.keyCode;			
	  if(iKeyCode>=48 && iKeyCode<=57) return true;
	  return false;
	}

function form1Validator(theForm)
{


	if  (numberPrizesRemaing != 0 && prizeAmount != 33) {
    alert("To easily select the correct number of prizes, please use the calculator on the right side.");
    return (false);
	
	}

  return (true);
}
//calculatorAmt = you can select more
//amtInCart = amt of tickets you selected
//ticketnum = ticket number added
//ticketname = ticket name just added
//upsellmessage = 20 you can get the Full Shmorg
//totalcost = total cost
//winamount = total cost * 1000

/*
if you click a package amt onclick(price, amtticket,free)
change 'for another'
if you add quantity to specific item onclick(num,name, amt)
-add that amt to total amt in cart
-add to calculator, how many have left, name and number of prize
-only show calculator is they pick a specific package amt and aren't over yet.
calculator previous message: Calculator: You can select 10 more tickets.
-check if they hit point where they can get free tickets. or up the total cost in cart.
*/
function choosePackage(price, amtticket,free, extra) { 
	/*if (document.getElementById('calcstart').innerHTML == "false") {
		$(this).removeClass('btnHid')
			$('#fixedfooter-Btm').slideDown(300);
			document.getElementById('calcstart').innerHTML = "true";
	}*/
	 if (extra == "none" ) {
document.form1.packageTickets.value = 0; 
document.form1.packageSelected.value = 0; 


calculate('','','0','start');
		 	var calculatorAmt = calculatePrizes();

	     document.getElementById('calculatorString').innerHTML = "Start Selecting Prizes";

document.form1.amtInCartValue.value= calculatorAmt; 
	 }else {
	var calculatorAmt = calculatePrizes();

  totalTicketsAllowed = (Number(amtticket) + Number(free));
 var Tickets = new Array();
  Tickets = amtPackages(totalTicketsAllowed);
var PackageCost = Tickets[0];
var freeTicket = Tickets[1];
var nextPackage = Tickets[2];
var getWhat =  Tickets[3];

	numberPrizesRemaing = (Number(amtticket) + Number(free) - calculatorAmt);
	if  (numberPrizesRemaing > 0 ) {
    document.getElementById('calculatorString').innerHTML = " Select " + numberPrizesRemaing + " more tickets.";
	}
	if  (numberPrizesRemaing == totalTicketsAllowed ) {
    document.getElementById('calculatorString').innerHTML = " Select " + numberPrizesRemaing + " tickets.";
	}
	if  (numberPrizesRemaing < 0 ) {
		newcalc = numberPrizesRemaing * -1;
    document.getElementById('calculatorString').innerHTML = " Select " + newcalc + " less tickets.";
	}
	 //million $ prize
 millionamt = (price * 1000.00);
 	 if (millionamt > 1000000) {
 millionamt = 1000000;
 }
 
 //calculate free gifts
 	if (price >= 250) { // check if deserve free gifts
calculation = ( price / 250);
 amtFreeGifts =   parseInt(calculation);
	} 
	else {
		 amtFreeGifts =   0;
	}
	// end 
winamt =  CommaFormatted(millionamt + '.00');
 document.getElementById('winamount').innerHTML = winamt;
  document.getElementById('totalcost').innerHTML = price;
  document.getElementById('totalcost2').innerHTML = price;
  document.getElementById('freegiftamt').innerHTML = amtFreeGifts;
 
differencePrice = Number(nextPackage) - Number(PackageCost);
/* old upsell
 document.getElementById('upsellmessage').innerHTML = " For Another $" + differencePrice + " you can get " + getWhat; */
 if (totalTicketsAllowed < 230 ) {
 document.getElementById('upsellmessage').innerHTML = " For just $" + differencePrice+ " upgrade to our $" + nextPackage + " package and you can get " + getWhat;
	  } else {
		   document.getElementById('upsellmessage').innerHTML = " For each additional $250 upgrade, you will receive another free gift";
	  }
//mark in hidden field total tickets allowed
document.form1.packageTickets.value = totalTicketsAllowed; 
		document.form1.totalChargeBox.value= price; 
	document.form1.amtInCartValue.value= calculatorAmt; 
	document.form1.packageSelected.value  = price;
	 } // end extra function

}

function calculate(num,name,amt,field) {
console.log("NuM: "  +num);
console.log("name: " + name);
console.log("amt; " + amt);
	page = document.form1.pageName.value;

//	if (page ==  "prize" ) { 
//if (document.getElementById('calcstart').innerHTML == "false" && field  != "start") {
	//	$(this).removeClass('btnHid');
		//	$('#fixedfooter-Btm').slideDown(300);
		//	document.getElementById('calcstart').innerHTML = "true";
//	}
//	}
 //-make sure it's numerical
 if (isNaN(amt) || amt < 0 ) {
		document.getElementById(field).value = 0 ;
		document.getElementById(field).focus();

//if (page == "cart") {
		calculate(num, name, 0, field);
//}

 } else {

	var calculatorAmt = calculatePrizes();
			var Tickets = new Array();

		if (document.form1.packageTickets.value != "0"  && calculatorAmt <= document.form1.packageTickets.value) {
		//	if (document.form1.packageTickets.value =="6" || document.form1.packageTickets.value =="9" || document.form1.packageTickets.value =="19" || document.form1.packageTickets.value =="24" ||document.form1.packageTickets.value =="60" ||document.form1.packageTickets.value =="120"|| document.form1.packageTickets.value =="240"){
			
			 Tickets = amtPackages(document.form1.packageTickets.value);	

			//}
		} else {
				 Tickets = amtPackages(calculatorAmt);
 }
		//if (field == "start" ) {
		//}
 //run complete function
// var Tickets = amtPackages(calculatorAmt);
	var PackageCost = Tickets[0];
	var freeTicket = Tickets[1];
	var nextPackage = Tickets[2];
	var getWhat =  Tickets[3];
	var 	totalTicketsAllowed =  Tickets[4];
	differencePrice = nextPackage - PackageCost;
	var freeTicketString;

//figure out how much yoUu need to pay, what point do you add free tickets into the calculated cost.
if(   totalTicketsAllowed == 0) {
	realTickets = calculatorAmt - freeTicket;
	freeTicketString = freeTicket;
} else {
	realTickets = totalTicketsAllowed - freeTicket;
	freeTicketString = calculatorAmt - realTickets;

}
if (document.form1.packageTickets.value != "0" ) { //&& calculatorAmt <= document.form1.packageTickets.value ) {
	//i picked a package didn't go over it yet
	//7 >  6-1
	//5 
	if (calculatorAmt > totalTicketsAllowed -freeTicket) {
	realTickets = calculatorAmt - freeTicket;
	freeTicketString = freeTicket;
	} else {
	realTickets = calculatorAmt;
	freeTicketString = 0 ;

}

}
	 document.getElementById('amtInCartValue').innerHTML = calculatorAmt; //changed this
	 //if not start of page
	 if (field != "start" || page == "cart") {
	if (amt != 0) {
//	 document.getElementById('ticketnum').innerHTML = amt + "-";
//	  document.getElementById('ticketname').innerHTML = name + " added to cart.";
var count = $("#listprizesSelected li").length;
		alreadyExists= "false";

for (i=0;i<=count;i++ ){
strTicketname= $('#ticket'+i + ' .ticketname ').text();
	if (strTicketname.indexOf(name) >= 0)
	{
		alreadyExists= "true";
		break;

	}
}

if (alreadyExists== "true")
 {
	$('#ticketnum'+i).text(amt);
}else {

	  fullLiString = " <div class=name id=ticket" + count +"><span id=ticketname class=ticketname>" + name + " </span></div> <div class=qty><span>x <span id=ticketnum"+ count +">" + amt + "</span> </span><a href='#' class='remove' title='delete'  onclick=removeItem('" + count + "','"+ field+"');  ><img  id=remove"+ count+" src=images/remove.png /></a></div>" ;
	$('#listprizesSelected').append(
    $('<li id=liList'+ count +'>').append(fullLiString));  
}




	}  else {
			 document.getElementById('ticketnum').innerHTML = "";
	  document.getElementById('ticketname').innerHTML = name + " removed from cart.";
	}
	 }
	//upsell message:   For Another $20 you can get the Full Shmorg
 if (calculatorAmt ==0) {
	  document.getElementById('totalTickets').innerHTML = "";
	   document.getElementById('totalcost').innerHTML  = "0";
//	   document.getElementById('totalcost2').innerHTML  = "0";
	    document.getElementById('upsellmessage').innerHTML = "";
			 document.getElementById('winamount').innerHTML = "0";

 } else {
totalTicketsString  =  realTickets + " ticket"  + ticketString(realTickets)+ " in cart. ";
  if (freeTicket > 0 ) {
totalTicketsString = realTickets + " ticket" + ticketString(realTickets)+" + "  + freeTicketString + " free ticket"  + ticketString(freeTicketString) + ".";
  }
  if (page == "cart"  ) {
  totalTicketsString =totalTicketsString.replace("Total - ", "");
  }
  document.getElementById('totalTickets').innerHTML = totalTicketsString ;
  document.getElementById('totalcost2').innerHTML = PackageCost;
  	  document.getElementById('totalcost').innerHTML = PackageCost;
	  
	//totalcost = total cost
	//winamount = total cost * 1000
 //million $ prize
 	millionamt = (PackageCost * 1000.00);
		 if (millionamt > 1000000) {
 millionamt = 1000000;
 }
	winamt =  CommaFormatted(millionamt + '.00');
	 document.getElementById('winamount').innerHTML = winamt;

if (page == "cart") {
//document.getElementById('cartFree').innerHTML = freeTicketString + " free ticket"  + ticketString(freeTicketString);
}
 // document.getElementById('upsellmessage').innerHTML = "You have " + freeTicket + " free tickets";
  // picked $100 package no upsell
	  if (calculatorAmt < 230) { 
		 document.getElementById('upsellmessage').innerHTML = " For just $" + differencePrice+ " more, upgrade to our $" + nextPackage + " package and you can get " + getWhat;
	  } else {
		   document.getElementById('upsellmessage').innerHTML = " For each additional $250 upgrade, you will receive another free gift.";
	  }
 } // end if calculator amt is now 0 
	numberPrizesRemaing = Number(totalTicketsAllowed) - Number(calculatorAmt);
 if (calculatorAmt < totalTicketsAllowed) {

    document.getElementById('calculatorString').innerHTML = " Select " + numberPrizesRemaing + " more ticket" + ticketString(numberPrizesRemaing) + " .";
 }  else if (calculatorAmt < document.form1.packageTickets.value ) {
     document.getElementById('calculatorString').innerHTML = " Select " + numberPrizesRemaing + " more ticket" + ticketString(numberPrizesRemaing) + ".";
 } else {
   document.getElementById('calculatorString').innerHTML = "";
 }
	  if (numberPrizesRemaing == 0) {
	     document.getElementById('calculatorString').innerHTML = "";

	  }
	
// you went over the package amt
	  if (document.form1.packageTickets.value != "0" && calculatorAmt > document.form1.packageTickets.value ) {
packageOver = 	  calculatorAmt - document.form1.packageTickets.value;
  document.getElementById('calculatorString').innerHTML = " You selected " + (packageOver)+ " additional ticket" + ticketString(packageOver) + ".";
	  }
//if picked more tickets into next package move radio button up
// amt tickets you picked  > how many you can have
 /*if (calculatorAmt > document.form1.packageTickets.value ) {
  document.getElementById('option8').checked = true;
// document.forms['form1'].elements['option1'][//1].checked = true;

// document.forms['form1'].elements['option1'][0].checked = true;
//document.form1.option1[4].checked = true; 
	}*/

//save all information in hidden textboxes
if (document.form1.packageTickets.value != "0" ) {
	document.form1.amtInCartValue.value= totalTicketsAllowed; 

} else {
		document.form1.amtInCartValue.value= calculatorAmt; 
		}

	document.form1.realTicketsBox.value= realTickets; 
	document.form1.FreeTicketsBox.value= freeTicketString; 
	document.form1.totalChargeBox.value= PackageCost; 

 } //end if numerical
 
 
 } //end function

function changefield(field) {

document.getElementById('tr' + field).style.display= "none";


}
function amtPackages(num) {
var cost;
var freeTicket;
var nextPackage;
var getWhat;
var ticketsAllowed = 0;
	if (num == 0){ // amt of tickets total in your cart
		cost=0; //total cost
		freeTicket = 0; //free tickets you get
		nextPackage = 25;
		getWhat = "1 free ticket.";
				ticketsAllowed = 0;

	}
	if (num == 1){ // amt of tickets total in your cart
		cost=5; //total cost
		freeTicket = 0; //free tickets you get
		nextPackage = 25;
		getWhat = "1 free ticket.";
				ticketsAllowed = 1;

	}
	
	if (num > 1 && num < 5){
		cost= num*5;
		freeTicket = 0;
		nextPackage = 25;
		getWhat = "1 free ticket.";
	

	}
	
	if (num ==5 ){
		cost= 25;
		freeTicket = 1;
		nextPackage = 40;
		getWhat = "1 Shmorg CD.";
		ticketsAllowed = 6;
	}
	if (num ==6 ){
		cost= 25;
		freeTicket = 1;
		nextPackage = 40;
		getWhat = "1 Shmorg CD.";
				ticketsAllowed = 6;

	}
	
	if (num >= 7 && num <=10){ //4.28
		cost= (num - 1) * 5;
		freeTicket = 1;
		nextPackage = 80;

		getWhat =  "2 Shmorg CDs.";



	}
/*	if (num == 8){// 4.44
		cost= 35;
		freeTicket = 1;
		nextPackage = 40;
		getWhat =  "1 Shmorg CD.";
					ticketsAllowed = 8;

	}
	*/
if (num == 9){
		cost= (num - 1) * 5;
		freeTicket = 1;
		nextPackage = 80;

		getWhat =  "2 Shmorg CDs.";

						ticketsAllowed = 9;

	}
	if (num == 11){
		cost= 50;
		freeTicket = 2;
		nextPackage = 80;
		getWhat =  "3 free tickets and 2 Shmorg CDs.";
						ticketsAllowed = 12;

	}

	
	if (num >= 12 && num < 17){
		cost= (num - 2) * 5;
		freeTicket = 2;
		nextPackage = 80;
		getWhat =  "3 free tickets and 2 Shmorg CDs.";
	
	}
	if (num == 17 || num == 18){
		cost= 75;
		freeTicket = 3;
		nextPackage = 80;
		getWhat =  "3 free tickets and 2 Shmorg CDs.";
						ticketsAllowed = 18;

	}
	if (num == 19  ){//was 16
		cost= 80;
		freeTicket = 3;
		nextPackage = 100;
		getWhat =  "4 free tickets and Full Shmorg Set.";
							ticketsAllowed = 19;

	}
	
		if (num >= 20 && num <= 22 ){
		cost= (num - 3)  *5;
		freeTicket = 3;
		nextPackage = 100;
		getWhat =  "4 free tickets and Full Shmorg Set.";
	
	}
	if (num == 23 || num == 24){
		cost= 100;
		freeTicket =4;
		nextPackage = 250;
		getWhat =  "10 free tickets, Full Shmorg Set and 1 Gift.";
	    ticketsAllowed = 24;

	}
/*	if ( num == 25 ){//was 16
		cost= (num-4 ) *5;
		freeTicket = 4;
		nextPackage = 250;
		getWhat =  "15 free tickets, Full Shmorg Set and 1 Gift.";

	}
	*/ // over $100
	if (num >= 25 && num <= 58 ){
			getWhat =  "10 free tickets, Full Shmorg Set and 1 Gift.";
amtTicketsAfter1000 = num - 24; 
//  amtTicketsAfter1000 = num;
  if (amtTicketsAfter1000 < 5) {
	  				cost= (num-4 ) *5;
		freeTicket = 4;
		nextPackage = 250;
		getWhat =  "10 free tickets, Full Shmorg Set and 1 Gift.";


 } else {
	 amtTicketsOver50 =  amtTicketsAfter1000 - 5;
	 howManyTimesOver = parseInt(amtTicketsOver50 / 6);

	 if (howManyTimesOver >=1) {

		 for (i=amtTicketsOver50; i >=6 ;) {
			amtTicketsOver50= amtTicketsOver50 -6;
			 i= i -6;

		 }
	 }
//howManyTimesOver really 1 more
howManyTimesOver = howManyTimesOver +1;

  if ( amtTicketsOver50 == 0) {
	  calTickets = (6*howManyTimesOver);
		ticketsAllowed = 24 +calTickets; //, TICKETS NEED to add up to 65 but charge 50
		calcCost = (howManyTimesOver * 25);
		cost = 100 + calcCost;
		freeTicket = 4 + (1*howManyTimesOver);

 } else if (amtTicketsOver50 >=  1 && amtTicketsOver50 <=  5) {
	 // , -15*5 out of the cost  free gift.
//	totalticketsallowed = 260 + (65*howManyTimesOver) + amtTicketsOver50; //, TICKETS NEED to add up to 65 but charge 50
	cost = 100 + ((amtTicketsAfter1000-howManyTimesOver)*5);
		freeTicket = 4 + (1*howManyTimesOver);

 }
 
 }
				nextPackage = 250;
	} // over $100

		
			if (num >= 59 && num <= 60){
		cost= 250;
		freeTicket = 10;
		nextPackage = 500;
		getWhat =  "20 free tickets, Full Shmorg Set and 3 Gifts.";
										ticketsAllowed = 60;
	}
	//between 250 and 500
	if (num >= 61 && num <= 118 ){
		nextPackage = 500;
		getWhat =  "20 free tickets, Full Shmorg Set and 3 Gifts*.";
amtTicketsAfter1000 = num - 60; 
//  amtTicketsAfter1000 = num;
  if (amtTicketsAfter1000 < 5) {
	  				cost= (num-10 ) *5;
		freeTicket = 10;

 } else {
	 amtTicketsOver50 =  amtTicketsAfter1000 - 5;
	 howManyTimesOver = parseInt(amtTicketsOver50 / 6);
	 if (howManyTimesOver >=1) {
		 for (i=amtTicketsOver50; i >=6 ;) {
			amtTicketsOver50= amtTicketsOver50 -6;
			 i= i -6;
		 }
	 }
//howManyTimesOver really 1 more
howManyTimesOver = howManyTimesOver +1;
  if ( amtTicketsOver50 == 0) {
	  calTickets = (6*howManyTimesOver);
		ticketsAllowed = 60 +calTickets; //, TICKETS NEED to add up to 65 but charge 50
		calcCost = (howManyTimesOver * 25);
		cost = 250 + calcCost;
		freeTicket = 10 + (1*howManyTimesOver);

 } else if (amtTicketsOver50 >=  1 && amtTicketsOver50 <=  5) {
	 // , -15*5 out of the cost  free gift.
//	totalticketsallowed = 260 + (65*howManyTimesOver) + amtTicketsOver50; //, TICKETS NEED to add up to 65 but charge 50
	cost = 250 + ((amtTicketsAfter1000-howManyTimesOver)*5);
		freeTicket = 10 + (1*howManyTimesOver);

 }
 
 }	
	}// end voer 250
	if (num >= 119 && num <= 120) {
		cost= 500;
		freeTicket = 20;
		nextPackage = 1000;
		getWhat =  "40 free tickets, Full Shmorg Set and an additional 2 Gifts*.";
				ticketsAllowed = 120;

	}
	//over 500
	if (num >= 121 && num <= 238 ){
		nextPackage = 1000;
		getWhat =  "40 free tickets, Full Shmorg Set and an additional 2 Gifts*.";
	amtTicketsAfter1000 = num - 120; 
//  amtTicketsAfter1000 = num;
  if (amtTicketsAfter1000 < 5) {
	  				cost= (num-20 ) *5;
		freeTicket = 20;

 } else {
	 amtTicketsOver50 =  amtTicketsAfter1000 - 5;
	 howManyTimesOver = parseInt(amtTicketsOver50 / 6);
	 if (howManyTimesOver >=1) {
		 for (i=amtTicketsOver50; i >=6 ;) {
			amtTicketsOver50= amtTicketsOver50 -6;
			 i= i -6;
		 }
	 }
//howManyTimesOver really 1 more
howManyTimesOver = howManyTimesOver +1;
  if ( amtTicketsOver50 == 0) {
	  calTickets = (6*howManyTimesOver);
		ticketsAllowed = 120 +calTickets; //, TICKETS NEED to add up to 65 but charge 50
		calcCost = (howManyTimesOver * 25);
		cost = 500 + calcCost;
		freeTicket =20 + (1*howManyTimesOver);

 } else if (amtTicketsOver50 >=  1 && amtTicketsOver50 <=  5) {
	 // , -15*5 out of the cost  free gift.
//	totalticketsallowed = 260 + (65*howManyTimesOver) + amtTicketsOver50; //, TICKETS NEED to add up to 65 but charge 50
	cost = 500 + ((amtTicketsAfter1000-howManyTimesOver)*5);
		freeTicket = 20 + (1*howManyTimesOver);

 }
 
 }	

	
	}// end over 500
	if (num >= 239 && num <= 240) {
		cost= 1000;
		freeTicket = 40;
		ticketsAllowed = 240;

	}
	//add calculation for over 1000

 if (num > 240) {
amtTicketsAfter1000 = num - 240; 
//  amtTicketsAfter1000 = num;
  if (amtTicketsAfter1000 < 5) {
	  				cost= (num-40 ) *5;
		freeTicket = 40;

 } else {
	 amtTicketsOver50 =  amtTicketsAfter1000 - 5;
	 howManyTimesOver = parseInt(amtTicketsOver50 / 6);
	 if (howManyTimesOver >=1) {
		 for (i=amtTicketsOver50; i >=6 ;) {
			amtTicketsOver50= amtTicketsOver50 -6;
			 i= i -6;
		 }
	 }
//howManyTimesOver really 1 more
howManyTimesOver = howManyTimesOver +1;
  if ( amtTicketsOver50 == 0) {
	  calTickets = (6*howManyTimesOver);
		ticketsAllowed = 240 +calTickets; //, TICKETS NEED to add up to 65 but charge 50
		calcCost = (howManyTimesOver * 25);
		cost = 1000 + calcCost;
		freeTicket =40 + (1*howManyTimesOver);

 } else if (amtTicketsOver50 >=  1 && amtTicketsOver50 <=  5) {
	 // , -15*5 out of the cost  free gift.
//	totalticketsallowed = 260 + (65*howManyTimesOver) + amtTicketsOver50; //, TICKETS NEED to add up to 65 but charge 50
	cost = 1000 + ((amtTicketsAfter1000-howManyTimesOver)*5);
		freeTicket = 40 + (1*howManyTimesOver);

 }
 
 }	
 }//end $over 260
 //at the end when picking free gifts, if total cost is over $1000, then do amtTicketsAfter1000/65 = amt of free gifts you will get.
//end over $10000
		return [cost, freeTicket, nextPackage, getWhat, ticketsAllowed];


}// end function
 
/**
*   Usage:  CommaFormatted(12345678);
*   result: 12,345,678
**/

function CommaFormatted(amount) {
    var delimiter = ","; // replace comma if desired
    amount = new String(amount);
    var a = amount.split('.',2);
    var d = a[1];
    var i = parseInt(a[0]);
    if(isNaN(i)) { return ''; }
    var minus = '';
    if(i < 0) { minus = '-'; }
    i = Math.abs(i);
    var n = new String(i);
    var a = [];
    while(n.length > 3)
    {
        var nn = n.substr(n.length-3);
        a.unshift(nn);
        n = n.substr(0,n.length-3);
    }
    if(n.length > 0) { a.unshift(n); }
    n = a.join(delimiter);
    if(d.length < 1) { amount = n; }
    else { amount = n ; }
    amount = minus + amount;
    return amount;
}
function ticketString(str) {
 if ( str == 1 ) {
 return	  "";
	  }else {
		return   "s";
	  }
}

function checkoutNow() {
	if (calculatorAmt == 0 ) {
alert("Please select your tickets before checking out.");
return false;
	}
	if ( document.form1.packageTickets.value != "0") {
		var calculatorAmt = calculatePrizes();
			var Tickets = new Array();
		 Tickets = amtPackages(calculatorAmt);
		var PackageCost = Tickets[0];
		var freeTicket = Tickets[1];
		var nextPackage = Tickets[2];
		var getWhat =  Tickets[3];
		var 	totalTicketsAllowed =  Tickets[4];
		differencePrice = nextPackage - PackageCost;
		var freeTicketString;
		ticketRemaining =  document.form1.packageTickets.value - calculatorAmt ; 
if (ticketRemaining > 0 ) {
alert("You need to select " + ticketRemaining +  " additional ticket" + ticketString(ticketRemaining)  + "  before checking out.");
return false;
}
 if (ticketRemaining < 0 ){
	 ticketRemainingstring = ticketRemaining * -1;
	var r=confirm("You have selected " + ticketRemainingstring + " additional ticket" + ticketString(ticketRemainingstring) + " above your $" + document.form1.packageSelected.value + "  package. Your new total is $" + PackageCost + " . Click “ok” to accept or “cancel” to modify your selections.");
if (r==true)   {
//  x="You pressed OK!";
document.form1.submit();
  return true;
  } else   {
//  x="You pressed Cancel!";
  return false;
  } 
  

} //picked too much
	}
//submitCart();
document.form1.submit();


} // end function checkoutnow

//when someone wants to submit cart double check doesn't have free extra tickets
function submitCart () {
$.post(
     "scripts/savecart.asp",
     $("#form1").serialize()
);}


<div class="wrapper">
    <header>
    <div class="header-container">
        <div class="logo">
            <a href="/"><img src="images/logo.png"> </a>
        </div>
        <div class="mobile-menu-icon">
            <a class="mobileNavigation" href="#"></a>
        </div>
        <div class="menu-wrapper">
            <div class="quick-menu">
                <ul class="quick-links">
                    <li><a href="#">About oorah</a> </li>
                    <li><a href="#">call 1877-auction</a> </li>
                </ul>
                <!--<ul class="shop-menu">-->
                <!--<li class="prizes"><a href="#">shop prizes</a> </li>-->
                <!--<li class="cart"><a href="#">cart <label>(201)</label> </a> </li>-->

                <!--</ul>-->
            </div>
            <div class="main-menu">
                <ul>
                    <li>
                        <a href="#">how it works </a>
                    </li>
                    <li>
                        <a href="#">$1,000,000 raffle </a>
                    </li>
                    <li>
                        <a href="free-gifts.asp">free gifts  </a>
                    </li>
                    <li class="prizes"><a href="prizes.asp">shop prizes</a> </li>
                    <li class="cart"><a href="https://www.oorahauction.org/checkout.asp">cart <label>  22</label> </a> </li>
                </ul>
                <ul class="quick-links mobile">
                    <li><a href="#">About oorah</a> </li>
                    <li><a href="#">call 1877-auction</a> </li>
                </ul>
            </div>
            <ul class="mobile-menu">
                <li class="prizes"><a href="prizes.asp">shop prizes</a> </li>
                <li class="cart"><a href="https://www.oorahauction.org/checkout.asp">cart <label>  22</label></a> </li>
            </ul>


        </div>
    </div>
</header> 
<script>
  var totalCost = 40 ;
  var  totalTickets = 22 ;
 var amtInCart = 22;
 

</script>

<script type="text/javascript" src="scripts/orderScripts.js"></script>

<script type="text/javascript" src="scripts/checkout.js"></script>
 <form action="/checkout.asp" method="post" name="form1" id="form1" onsubmit="return FrontPage_Form1_Validator(this)">
  <div class="container">
    
        
        <div class="page-heading">
        
       

            <h2>Check out Number: 736658099080623 &amp; Place your order</h2>
        </div>
        <div class="checkout-wrapper">
            
                <div class="checkout-breadcrumb">
                    <ul>
                    <li class="first "><h3><a class="active" href="#" data-id="review" data-slide-index="0"><span>1</span> Review Cart &gt;&gt;&gt;</a></h3></li>
                    <li class="second "><h3><a href="#" data-slide-index="1"><span>2</span> Choose Free Gifts &gt;&gt;&gt;</a></h3></li>
                    <li class="third"><h3><a href="#" data-slide-index="2"><span>3</span> Payment Info </a></h3></li>
                </ul>

                </div>
                 

     <div style="max-width: 100%;" class="bx-wrapper"><div style="width: 100%; overflow: hidden; position: relative; height: 1102px;" class="bx-viewport"><div style="width: 515%; position: relative; transition-duration: 0s; transform: translate3d(-960px, 0px, 0px);" class="checkout-step-wrapper"><div style="float: left; list-style: none outside none; position: relative; width: 960px;" class="step3 checkout-step payment-info bx-clone">
        <!--     <div class="checkout-breadcrumb">
                <ul>
                    <li class="first active"><h3><span>1</span>Review Cart &gt;&gt;&gt;</h3></li>
                    <li class="second active"><h3><span>2</span>Choose Free Gifts &gt;&gt;&gt;</h3></li>
                    <li class="third active"><h3><span>3</span>Payment Info</h3></li>
                </ul>
            </div> -->
            <div class="checkout-step-content">
                <div class="header">
                    <h3>Enter your Payment info</h3>
                </div>
               
                    <fieldset>
                <div class="billing-info">
                    <h4>Billing info</h4>

                            <ul>
                                <li class="fields">
                                    <label>Country</label>
                                    <div class="input-box">
                                        <select name="ccf_country" onchange="BuildModels(this.selectedIndex);">
      <option value="UNITED STATES" selected="selected">UNITED STATES</option>
      <option value="CANADA">CANADA</option>
      <option value="ISRAEL">ISRAEL</option>
      <option value="UNITED KINGDOM">ENGLAND</option>
      <option value="ARGENTINA">ARGENTINA</option>
      <option value="AUSTRALIA">AUSTRALIA</option>
      <option value="AUSTRIA">AUSTRIA</option>
      <option value="BELGIUM">BELGIUM</option>
      <option value="BRAZIL">BRAZIL</option>
      <option value="FRANCE">FRANCE</option>
      <option value="MEXICO">MEXICO</option>
      <option value="SWITZERLAND">SWITZERLAND</option>
      <option value="UKRAINE">UKRAINE</option>
      <option value="">
        
        </option>
    </select>
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Title</label>
                                    <div class="input-box">
                                       <select name="ccf_title" id="ccf_title">
      <option value="" selected="selected">
        
        </option>
      <option value="Mr.">Mr.</option>
      <option value="Mrs.">Mrs.</option>
      <option value="Ms.">Ms.</option>
      <option value="Rabbi">Rabbi</option>
    </select>
                                    </div>
                                </li>
                                  <li class="fields">
                                    <label>First name</label>
                                    <div class="input-box">
                                       <input name="ccf_FirstName" id="ccf_FirstName" class="F-name" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Last name</label>
                                    <div class="input-box">
                                     <input name="ccf_LastName" id="ccf_LastName" class="l-name" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Address &amp; apt</label>
                                    <div class="input-box">
                                        <input name="ccf_Address" class="address" id="ccf_Address" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>city</label>
                                    <div class="input-box">
                                  <input name="ccf_City" class="city" id="ccf_City" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>state</label>
                                    <div class="input-box">
                                        <select name="ccf_state" id="ccf_state" class="state">
      <option value="" selected="selected"></option>
      <option value="AL">AL </option>
      <option value="AZ">AZ </option>
      <option value="AR">AR </option>
      <option value="CA">CA </option>
      <option value="CO">CO </option>
      <option value="CT">CT </option>
      <option value="DE">DE </option>
      <option value="DC ">DC </option>
      <option value="FL">FL </option>
      <option value="GA">GA </option>
      <option value="HI">HI </option>
      <option value="ID">ID </option>
      <option value="IL">IL </option>
      <option value="IN">IN </option>
      <option value="IA">IA </option>
      <option value="KS">KS </option>
      <option value="KY">KY </option>
      <option value="LA">LA </option>
      <option value="ME">ME </option>
      <option value="MD">MD </option>
      <option value="MA">MA </option>
      <option value="MI">MI </option>
      <option value="MN">MN </option>
      <option value="MS">MS </option>
      <option value="MO">MO </option>
      <option value="MT">MT </option>
      <option value="NE">NE </option>
      <option value="NV">NV </option>
      <option value="NH">NH </option>
      <option value="NJ">NJ </option>
      <option value="NM">NM </option>
      <option value="NY">NY </option>
      <option value="NC">NC </option>
      <option value="ND">ND </option>
      <option value="OH">OH </option>
      <option value="OK">OK </option>
      <option value="OR">OR </option>
      <option value="PA">PA </option>
      <option value="RI">RI </option>
      <option value="SC">SC </option>
      <option value="SD">SD </option>
      <option value="TN">TN </option>
      <option value="TX">TX </option>
      <option value="UT">UT </option>
      <option value="VT">VT </option>
      <option value="VA">VA </option>
      <option value="WA">WA </option>
      <option value="WV">WV </option>
      <option value="WI">WI </option>
      <option value="WY">WY </option>
    </select>
      <input name="ccf_state2" class="invisible state" id="ccf_state2" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Zip</label>
                                    <div class="input-box">
                                        <input name="ccf_ZipCode" id="ccf_ZipCode" value="" class="zip" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Email</label>
                                    <div class="input-box">
                                       <input name="ccf_Email" class="email" id="ccf_Email" value="" type="email">
                                       <br>
      Confirmation is sent to this email address.
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Home Phone</label>
                                    <div class="input-box">
                                       <input name="ccf_HomePhone" class="phone" id="ccf_HomePhone" value="" type="tel">
                                    </div>
                                </li>
                                  <li class="fields">
                                    <label>Cell Phone</label>
                                    <div class="input-box">
                                     <input id="cellphone" class="phone" name="cellphone" value="" type="tel">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Donor Number</label>
                                    <div class="input-box">
                                   <input name="ccf_donornumber" id="ccf_donornumber" value="" maxlength="7" type="number">
                                     <br>
You can find your donor number on the back cover of your auction book.
                                    </div>
                                </li>
                            </ul>

                </div>
                <div class="card-info">
                    <h4>Card info</h4>
                    <ul>
                        <li class="fields">
                            <label>Card Type</label>
                            <div class="input-box">
                               <select name="ccf_CreditCard" id="ccf_CreditCard">
      <option value="" class="card-type" selected="selected">
        
        </option>
      <option value="Visa">Visa</option>
      <option value="MasterCard">MasterCard</option>
      <option value="Discover">Discover</option>
      <option value="Amex">Amex</option>
      <option value="IsraCard">IsraCard</option>
      <option value="DinersClub">Diners</option>
    </select>
                            </div>
                        </li>
                        <li class="fields">
                            <label>Card number</label>
                            <div class="input-box">
                               <input name="ccf_CCNumber" class="card-no" id="ccf_CCNumber" value="" size="16" maxlength="16" type="tel">
                            </div>
                        </li>
                        <li class="fields two">
                            <label>Expiration</label>
                            <div class="input-box">
                                <select name="ccf_CCMonth" size="1" id="ccf_CCMonth" class="select2">
      <option value="" selected="selected">
        
        </option>
      <option value="01">01</option>
      <option value="02">02</option>
      <option value="03">03</option>
      <option value="04">04</option>
      <option value="05">05</option>
      <option value="06">06</option>
      <option value="07">07</option>
      <option value="08">08</option>
      <option value="09">09</option>
      <option value="10">10</option>
      <option value="11">11</option>
      <option value="12">12</option>
    </select>
      &nbsp;
      /
      <select name="ccf_CCYear" size="1" id="ccf_CCYear" class="select2">
        <option value="" selected="selected">
          
          </option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>

      </select>
                            </div>
                        </li>
                        <li class="fields">
                            <label>Security Code</label>
                            <div class="input-box">
                              <input name="ccf_security" id="ccf_security" value="" size="4" maxlength="4" type="number">  <br>
      The last 3 or 4 digits, located on the back of your card.
                            </div>
                        </li>
                        <li class="fields invisible" id="canFunds">
                          <input name="ccf_Canada" id="ccf_Canada" value="true" type="checkbox">
<span class="note"> I would like to be charged in Canadian funds, and receive a Canadian receipt</span>.<br>
                        </li>
                         <li class="fields invisible" id="IsraelFunds">
                         <input name="ccf_Israel" id="ccf_Israel" value="true" type="checkbox">
              <span class="note"> I would like to be charged in Shekolim.</span><br>
                        </li>
                    </ul>
                    <br><div id="taxmessage">Tax receipts will be for US taxes unless otherwise selected. Oorah
      takes no responsibility for incorrect selections.</div>
                </div>
                <div class="button-set">
                    <div class="info">
                        Your credit card
            will be charged after you place your order. <strong>Wait
            for the confirmation screen to show that your order
            has been submitted,</strong> it might take a few moments,
            so please be patient to ensure your card does not get
            charged twice. 
                    </div>
                  <button class="place-order" type="submit">
                        <span>Place order &gt;</span>
                    </button>
                </div>
                </fieldset>
                <input id="pageName" name="pageName" value="cart" type="hidden">
       <input name="MM_insert" value="FrontPage_Form1" type="hidden">
    <input name="sessionVar" value="736658099080623" type="hidden">

    <input name="donation" id="donation" value="40-22" type="hidden">

<input name="howmanyoveramt" value="" id="howmanyoveramt" type="hidden">
<input name="orderFormTotal" id="orderFormTotal" value="40" type="hidden">
                          <input name="amtInCartValue" id="amtInCartValue" value="0" type="hidden">
  <input name="packageTickets" id="packageTickets" value="9" type="hidden">
  <input name="realTicketsBox" id="realTicketsBox" value="19" type="hidden">
  <input name="FreeTicketsBox" id="FreeTicketsBox" value="3" type="hidden">
  <input name="totalChargeBox" id="totalChargeBox" value="40" type="hidden">
    <input name="packageSelected" id="packageSelected" value="40" type="hidden">

                </div>
            </div>
               
                <div style="float: left; list-style: none outside none; position: relative; width: 960px;" class="step1 checkout-step review">
                <div class="checkout-step-content">
                    
                      
               <span id="upsellmessage" style="visibility:hidden"></span> <span id="calculatorString" style="visibility:hidden"></span>    
                    <ul class="item-ul">
                        <li class="header-li">
                            <div class="ticket">Your Tickets:</div>
                            <div class="price">Price:</div>
                            <div class="amount">Amount:</div>

                        </li>
                        
                         
                        <li id="liList1">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/1.jpg" height="48" width="58">
                                </div>
                                <div class="name"> 1. Eretz Yisroel</div>
                            </div>
               
                            <div class="amount">
                                <input value="16" size="5" readonly="" name="item1" id="prz1EretzYisroel" onchange="calculate('1', 'Eretz Yisroel', this.value,'prz1EretzYisroel');submitCart();" type="text">
                               <div class="invisible" id="button1"> 
                               <button type="button" onclick="submitCart();CancelItem('1','prz1EretzYisroel' );return false;">Save</button>
                               <button type="button" class="cancel" onclick="CancelItem('1','prz1EretzYisroel' );return false;">Cancel</button></div>
                             <a href="#" id="edit1" onclick="EditItem('1','prz1EretzYisroel' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onclick="removeItem('1','prz1EretzYisroel');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
                        <li id="liList2">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/2.jpg" height="48" width="58">
                                </div>
                                <div class="name"> 2. Rent &amp; Mortgage</div>
                            </div>
               
                            <div class="amount">
                                <input value="3" size="5" readonly="" name="item2" id="prz2RentAndMortgage" onchange="calculate('2', 'Rent &amp; Mortgage', this.value,'prz2RentAndMortgage');submitCart();" type="text">
                               <div class="invisible" id="button2"> 
                               <button type="button" onclick="submitCart();CancelItem('2','prz2RentAndMortgage' );return false;">Save</button>
                               <button type="button" class="cancel" onclick="CancelItem('2','prz2RentAndMortgage' );return false;">Cancel</button></div>
                             <a href="#" id="edit2" onclick="EditItem('2','prz2RentAndMortgage' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onclick="removeItem('2','prz2RentAndMortgage');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
                        <li id="liList3">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/3.jpg" height="48" width="58">
                                </div>
                                <div class="name"> 3. Hi Tech</div>
                            </div>
               
                            <div class="amount">
                                <input value="3" size="5" readonly="" name="item3" id="prz3HiTech" onchange="calculate('3', 'Hi Tech', this.value,'prz3HiTech');submitCart();" type="text">
                               <div class="invisible" id="button3"> 
                               <button type="button" onclick="submitCart();CancelItem('3','prz3HiTech' );return false;">Save</button>
                               <button type="button" class="cancel" onclick="CancelItem('3','prz3HiTech' );return false;">Cancel</button></div>
                             <a href="#" id="edit3" onclick="EditItem('3','prz3HiTech' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onclick="removeItem('3','prz3HiTech');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
        	<input value="0" name="item4" id="prz4DiamondNecklace" type="hidden"> 
	
        	<input value="0" name="item5" id="prz5GroceryGiveaway" type="hidden"> 
	
        	<input value="0" name="item6" id="prz6VisaGIftCard" type="hidden"> 
	
        	<input value="0" name="item7" id="prz7ThreeSheitels" type="hidden"> 
	
        	<input value="0" name="item8" id="prz8YourWheels" type="hidden"> 
	
        	<input value="0" name="item9" id="prz9MysteryPrize" type="hidden"> 
	
        	<input value="0" name="item10" id="prz10Tuition" type="hidden"> 
	
        	<input value="0" name="item11" id="prz11Outerspace" type="hidden"> 
	
        	<input value="0" name="item12" id="prz12DiningDecor" type="hidden"> 
	
        	<input value="0" name="item13" id="prz13Cash" type="hidden"> 
	
        	<input value="0" name="item14" id="prz14SukkosInIsrael" type="hidden"> 
	
        	<input value="0" name="item15" id="prz15FillErUp" type="hidden"> 
	
        	<input value="0" name="item16" id="prz16Lishmah" type="hidden"> 
	
        	<input value="0" name="item17" id="prz17Leichter" type="hidden"> 
	
        	<input value="0" name="item18" id="prz18VacationAnywhere" type="hidden"> 
	
        	<input value="0" name="item19" id="prz19FiveLaptops" type="hidden"> 
	
        	<input value="0" name="item20" id="prz20DebtFree" type="hidden"> 
	
        	<input value="0" name="item21" id="prz21FiveishMobile" type="hidden"> 
	
        	<input value="0" name="item22" id="prz22ShoppingSpree" type="hidden"> 
	
        	<input value="0" name="item23" id="prz23ClassicJewelry" type="hidden"> 
	
        	<input value="0" name="item24" id="prz24PricelessBrocha" type="hidden"> 
	
        	<input value="0" name="item25" id="prz25MakeAWish" type="hidden"> 
	
        	<input value="0" name="item26" id="prz26CustomSheitel" type="hidden"> 
	
        	<input value="0" name="item27" id="prz27SavingsBond" type="hidden"> 
	
        	<input value="0" name="item28" id="prz28Artscroll" type="hidden"> 
	
        	<input value="0" name="item29" id="prz29AmazonGiftCard" type="hidden"> 
	
        	<input value="0" name="item30" id="prz30Jackpot" type="hidden"> 
	
<script>
function EditItem(id, field) {
	$('#'+field ).attr('readonly', false);
	$('#button' + id).removeClass('invisible');
				$('#edit' + id).addClass('invisible');

}

function removeItem(id, field) {
	 $('#'+field).val('0');
submitCart();
	$('#liList' + id ).remove();
//	document.getElementById(field).value = 0;
	
}
function CancelItem(id, field) {
			$('#'+field ).attr('readonly', true);
			$('#button' + id).addClass('invisible');
				$('#edit' + id).removeClass('invisible');

}
</script>

 
                    </ul>
                    <div class="summary"><span id="totalcost2" style="visibility:hidden;">0</span>
                        <table>
                            <tbody><tr>
                                <td class="label">Order Total:  </td>
                                <td class="figure">$<span id="totalcost">40</span></td>
                            </tr>
                            <tr>
                                <td>Tickets: </td>
                                <td><span id="totalTickets">19<br>
You got 3 free tickets.</span><span id="freeTicketString"></span> </td>
                            </tr>
                            <tr>
                                <td>Free Gifts: </td>
                                <td><span id="freegiftamt">0</span></td>
                            </tr>
                            <tr class="red">
                                <td>Million Dollar Raffle  </td>
                                <td>$<span id="winamount">40,000.00 (40*1000) </span></td>
                            </tr>


                        </tbody></table>

                    </div>

                </div>
                <div class="button-set">
                 <a href="prizes.asp">      <button class="continue yellow" type="button">
  <span>                   Continue Shopping &gt;</span>
                    </button></a>
                    <button class="next" data-id="choose-gift" type="button">
                        <span>next &gt;</span>
                    <a class="bx-next" href="">next &gt;</a></button>
                </div>
            </div>
            <div style="float: left; list-style: none outside none; position: relative; width: 960px;" class="step2 hid checkout-step choose-gift">
           <!--     <div class="checkout-breadcrumb">
                        <ul>
                        <li class="first active"><h3><span>1</span><a href="#" data-id="review">Review Cart &gt;&gt;&gt;</a></h3></li>
                        <li class="second active"><h3><span>2</span>Choose Free Gifts &gt;&gt;&gt;</h3></li>
                        <li class="third"><h3><span>3</span>Payment Info</h3></li>
                    </ul>
                </div> -->
 <div class="checkout-step-content">
 
                    <div class="header">
                        <h3>Choose Your Gifts</h3>
                    </div>
                    <p>2013 Shmorg: Your eligible for <span id="actCdStr">1 CD</span>. Which one would  you like?</p>
                    <ul class="cd-list">
                        <li>
                            <span>Shmorg Tales Fiveish Musical Audio Story!</span>
                            <select name="cd1" id="cd1">
                    <option value="0" selected="selected">0</option>
                    <option value="1">1</option> 
                  </select>
                        </li>
                         <li>
                            <span>Shmorg Tunes #1 Music CD of the Year!</span>
                             <select name="cd2" id="cd2">
 <option value="0" selected="selected">0</option>
                    <option value="1">1</option>   </select>
                        </li>
                         <li>
                            <span>Shmorg Tube Over 4 hour DVD!</span>
                             <select name="cd3" id="cd3">
 <option value="0" selected="selected">0</option>
                    <option value="1">1</option>   </select>
                        </li>
                    </ul>
                      <!-- end free gifts over 250)-->
                   
                  
               <div class="button-set">
                        <button class="back yellow" type="button">
                            <span>back &gt;</span>
                        <a class="bx-prev" href="">back &gt;</a></button>
                        <button class="next" data-id="payment-info" type="button" onclick=" checkShmorg();">
                            <span>next &gt;</span>
                        <a class="bx-next" href="">next &gt;</a></button>
                    </div>
                </div>
               </div>
               
          
        <div style="float: left; list-style: none outside none; position: relative; width: 960px;" class="step3 checkout-step payment-info">
        <!--     <div class="checkout-breadcrumb">
                <ul>
                    <li class="first active"><h3><span>1</span>Review Cart &gt;&gt;&gt;</h3></li>
                    <li class="second active"><h3><span>2</span>Choose Free Gifts &gt;&gt;&gt;</h3></li>
                    <li class="third active"><h3><span>3</span>Payment Info</h3></li>
                </ul>
            </div> -->
            <div class="checkout-step-content">
                <div class="header">
                    <h3>Enter your Payment info</h3>
                </div>
               
                    <fieldset>
                <div class="billing-info">
                    <h4>Billing info</h4>

                            <ul>
                                <li class="fields">
                                    <label>Country</label>
                                    <div class="input-box">
                                        <select name="ccf_country" onchange="BuildModels(this.selectedIndex);">
      <option value="UNITED STATES" selected="selected">UNITED STATES</option>
      <option value="CANADA">CANADA</option>
      <option value="ISRAEL">ISRAEL</option>
      <option value="UNITED KINGDOM">ENGLAND</option>
      <option value="ARGENTINA">ARGENTINA</option>
      <option value="AUSTRALIA">AUSTRALIA</option>
      <option value="AUSTRIA">AUSTRIA</option>
      <option value="BELGIUM">BELGIUM</option>
      <option value="BRAZIL">BRAZIL</option>
      <option value="FRANCE">FRANCE</option>
      <option value="MEXICO">MEXICO</option>
      <option value="SWITZERLAND">SWITZERLAND</option>
      <option value="UKRAINE">UKRAINE</option>
      <option value="">
        
        </option>
    </select>
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Title</label>
                                    <div class="input-box">
                                       <select name="ccf_title" id="ccf_title">
      <option value="" selected="selected">
        
        </option>
      <option value="Mr.">Mr.</option>
      <option value="Mrs.">Mrs.</option>
      <option value="Ms.">Ms.</option>
      <option value="Rabbi">Rabbi</option>
    </select>
                                    </div>
                                </li>
                                  <li class="fields">
                                    <label>First name</label>
                                    <div class="input-box">
                                       <input name="ccf_FirstName" id="ccf_FirstName" class="F-name" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Last name</label>
                                    <div class="input-box">
                                     <input name="ccf_LastName" id="ccf_LastName" class="l-name" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Address &amp; apt</label>
                                    <div class="input-box">
                                        <input name="ccf_Address" class="address" id="ccf_Address" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>city</label>
                                    <div class="input-box">
                                  <input name="ccf_City" class="city" id="ccf_City" value="" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>state</label>
                                    <div class="input-box">
                                        <select name="ccf_state" id="ccf_state" class="state">
      <option value="" selected="selected"></option>
      <option value="AL">AL </option>
      <option value="AZ">AZ </option>
      <option value="AR">AR </option>
      <option value="CA">CA </option>
      <option value="CO">CO </option>
      <option value="CT">CT </option>
      <option value="DE">DE </option>
      <option value="DC ">DC </option>
      <option value="FL">FL </option>
      <option value="GA">GA </option>
      <option value="HI">HI </option>
      <option value="ID">ID </option>
      <option value="IL">IL </option>
      <option value="IN">IN </option>
      <option value="IA">IA </option>
      <option value="KS">KS </option>
      <option value="KY">KY </option>
      <option value="LA">LA </option>
      <option value="ME">ME </option>
      <option value="MD">MD </option>
      <option value="MA">MA </option>
      <option value="MI">MI </option>
      <option value="MN">MN </option>
      <option value="MS">MS </option>
      <option value="MO">MO </option>
      <option value="MT">MT </option>
      <option value="NE">NE </option>
      <option value="NV">NV </option>
      <option value="NH">NH </option>
      <option value="NJ">NJ </option>
      <option value="NM">NM </option>
      <option value="NY">NY </option>
      <option value="NC">NC </option>
      <option value="ND">ND </option>
      <option value="OH">OH </option>
      <option value="OK">OK </option>
      <option value="OR">OR </option>
      <option value="PA">PA </option>
      <option value="RI">RI </option>
      <option value="SC">SC </option>
      <option value="SD">SD </option>
      <option value="TN">TN </option>
      <option value="TX">TX </option>
      <option value="UT">UT </option>
      <option value="VT">VT </option>
      <option value="VA">VA </option>
      <option value="WA">WA </option>
      <option value="WV">WV </option>
      <option value="WI">WI </option>
      <option value="WY">WY </option>
    </select>
      <input name="ccf_state2" class="invisible state" id="ccf_state2" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Zip</label>
                                    <div class="input-box">
                                        <input name="ccf_ZipCode" id="ccf_ZipCode" value="" class="zip" type="text">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Email</label>
                                    <div class="input-box">
                                       <input name="ccf_Email" class="email" id="ccf_Email" value="" type="email">
                                       <br>
      Confirmation is sent to this email address.
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Home Phone</label>
                                    <div class="input-box">
                                       <input name="ccf_HomePhone" class="phone" id="ccf_HomePhone" value="" type="tel">
                                    </div>
                                </li>
                                  <li class="fields">
                                    <label>Cell Phone</label>
                                    <div class="input-box">
                                     <input id="cellphone" class="phone" name="cellphone" value="" type="tel">
                                    </div>
                                </li>
                                <li class="fields">
                                    <label>Donor Number</label>
                                    <div class="input-box">
                                   <input name="ccf_donornumber" id="ccf_donornumber" value="" maxlength="7" type="number">
                                     <br>
You can find your donor number on the back cover of your auction book.
                                    </div>
                                </li>
                            </ul>

                </div>
                <div class="card-info">
                    <h4>Card info</h4>
                    <ul>
                        <li class="fields">
                            <label>Card Type</label>
                            <div class="input-box">
                               <select name="ccf_CreditCard" id="ccf_CreditCard">
      <option value="" class="card-type" selected="selected">
        
        </option>
      <option value="Visa">Visa</option>
      <option value="MasterCard">MasterCard</option>
      <option value="Discover">Discover</option>
      <option value="Amex">Amex</option>
      <option value="IsraCard">IsraCard</option>
      <option value="DinersClub">Diners</option>
    </select>
                            </div>
                        </li>
                        <li class="fields">
                            <label>Card number</label>
                            <div class="input-box">
                               <input name="ccf_CCNumber" class="card-no" id="ccf_CCNumber" value="" size="16" maxlength="16" type="tel">
                            </div>
                        </li>
                        <li class="fields two">
                            <label>Expiration</label>
                            <div class="input-box">
                                <select name="ccf_CCMonth" size="1" id="ccf_CCMonth" class="select2">
      <option value="" selected="selected">
        
        </option>
      <option value="01">01</option>
      <option value="02">02</option>
      <option value="03">03</option>
      <option value="04">04</option>
      <option value="05">05</option>
      <option value="06">06</option>
      <option value="07">07</option>
      <option value="08">08</option>
      <option value="09">09</option>
      <option value="10">10</option>
      <option value="11">11</option>
      <option value="12">12</option>
    </select>
      &nbsp;
      /
      <select name="ccf_CCYear" size="1" id="ccf_CCYear" class="select2">
        <option value="" selected="selected">
          
          </option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>

      </select>
                            </div>
                        </li>
                        <li class="fields">
                            <label>Security Code</label>
                            <div class="input-box">
                              <input name="ccf_security" id="ccf_security" value="" size="4" maxlength="4" type="number">  <br>
      The last 3 or 4 digits, located on the back of your card.
                            </div>
                        </li>
                        <li class="fields invisible" id="canFunds">
                          <input name="ccf_Canada" id="ccf_Canada" value="true" type="checkbox">
<span class="note"> I would like to be charged in Canadian funds, and receive a Canadian receipt</span>.<br>
                        </li>
                         <li class="fields invisible" id="IsraelFunds">
                         <input name="ccf_Israel" id="ccf_Israel" value="true" type="checkbox">
              <span class="note"> I would like to be charged in Shekolim.</span><br>
                        </li>
                    </ul>
                    <br><div id="taxmessage">Tax receipts will be for US taxes unless otherwise selected. Oorah
      takes no responsibility for incorrect selections.</div>
                </div>
                <div class="button-set">
                    <div class="info">
                        Your credit card
            will be charged after you place your order. <strong>Wait
            for the confirmation screen to show that your order
            has been submitted,</strong> it might take a few moments,
            so please be patient to ensure your card does not get
            charged twice. 
                    </div>
                  <button class="place-order" type="submit">
                        <span>Place order &gt;</span>
                    </button>
                </div>
                </fieldset>
                <input id="pageName" name="pageName" value="cart" type="hidden">
       <input name="MM_insert" value="FrontPage_Form1" type="hidden">
    <input name="sessionVar" value="736658099080623" type="hidden">

    <input name="donation" id="donation" value="40-22" type="hidden">

<input name="howmanyoveramt" value="" id="howmanyoveramt" type="hidden">
<input name="orderFormTotal" id="orderFormTotal" value="40" type="hidden">
                          <input name="amtInCartValue" id="amtInCartValue" value="0" type="hidden">
  <input name="packageTickets" id="packageTickets" value="9" type="hidden">
  <input name="realTicketsBox" id="realTicketsBox" value="19" type="hidden">
  <input name="FreeTicketsBox" id="FreeTicketsBox" value="3" type="hidden">
  <input name="totalChargeBox" id="totalChargeBox" value="40" type="hidden">
    <input name="packageSelected" id="packageSelected" value="40" type="hidden">

                </div>
            </div>
        <div style="float: left; list-style: none outside none; position: relative; width: 960px;" class="step1 checkout-step review bx-clone">
                <div class="checkout-step-content">
                    
                      
               <span id="upsellmessage" style="visibility:hidden"></span> <span id="calculatorString" style="visibility:hidden"></span>    
                    <ul class="item-ul">
                        <li class="header-li">
                            <div class="ticket">Your Tickets:</div>
                            <div class="price">Price:</div>
                            <div class="amount">Amount:</div>

                        </li>
                        
                         
                        <li id="liList1">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/1.jpg" height="48" width="58">
                                </div>
                                <div class="name"> 1. Eretz Yisroel</div>
                            </div>
               
                            <div class="amount">
                                <input value="16" size="5" readonly="" name="item1" id="prz1EretzYisroel" onchange="calculate('1', 'Eretz Yisroel', this.value,'prz1EretzYisroel');submitCart();" type="text">
                               <div class="invisible" id="button1"> 
                               <button type="button" onclick="submitCart();CancelItem('1','prz1EretzYisroel' );return false;">Save</button>
                               <button type="button" class="cancel" onclick="CancelItem('1','prz1EretzYisroel' );return false;">Cancel</button></div>
                             <a href="#" id="edit1" onclick="EditItem('1','prz1EretzYisroel' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onclick="removeItem('1','prz1EretzYisroel');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
                        <li id="liList2">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/2.jpg" height="48" width="58">
                                </div>
                                <div class="name"> 2. Rent &amp; Mortgage</div>
                            </div>
               
                            <div class="amount">
                                <input value="3" size="5" readonly="" name="item2" id="prz2RentAndMortgage" onchange="calculate('2', 'Rent &amp; Mortgage', this.value,'prz2RentAndMortgage');submitCart();" type="text">
                               <div class="invisible" id="button2"> 
                               <button type="button" onclick="submitCart();CancelItem('2','prz2RentAndMortgage' );return false;">Save</button>
                               <button type="button" class="cancel" onclick="CancelItem('2','prz2RentAndMortgage' );return false;">Cancel</button></div>
                             <a href="#" id="edit2" onclick="EditItem('2','prz2RentAndMortgage' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onclick="removeItem('2','prz2RentAndMortgage');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
                        <li id="liList3">
                            <div class="ticket">
                                <div class="image">
                                    <img src="images/prizes/tiny/3.jpg" height="48" width="58">
                                </div>
                                <div class="name"> 3. Hi Tech</div>
                            </div>
               
                            <div class="amount">
                                <input value="3" size="5" readonly="" name="item3" id="prz3HiTech" onchange="calculate('3', 'Hi Tech', this.value,'prz3HiTech');submitCart();" type="text">
                               <div class="invisible" id="button3"> 
                               <button type="button" onclick="submitCart();CancelItem('3','prz3HiTech' );return false;">Save</button>
                               <button type="button" class="cancel" onclick="CancelItem('3','prz3HiTech' );return false;">Cancel</button></div>
                             <a href="#" id="edit3" onclick="EditItem('3','prz3HiTech' );return false;">  Edit</a>
                            </div>
                            <div class="remove">
                                <a href="#" class="remove" title="delete" onclick="removeItem('3','prz3HiTech');return false;"><img src="images/remove.png"></a>
                            </div>
                        </li>
                     
        	<input value="0" name="item4" id="prz4DiamondNecklace" type="hidden"> 
	
        	<input value="0" name="item5" id="prz5GroceryGiveaway" type="hidden"> 
	
        	<input value="0" name="item6" id="prz6VisaGIftCard" type="hidden"> 
	
        	<input value="0" name="item7" id="prz7ThreeSheitels" type="hidden"> 
	
        	<input value="0" name="item8" id="prz8YourWheels" type="hidden"> 
	
        	<input value="0" name="item9" id="prz9MysteryPrize" type="hidden"> 
	
        	<input value="0" name="item10" id="prz10Tuition" type="hidden"> 
	
        	<input value="0" name="item11" id="prz11Outerspace" type="hidden"> 
	
        	<input value="0" name="item12" id="prz12DiningDecor" type="hidden"> 
	
        	<input value="0" name="item13" id="prz13Cash" type="hidden"> 
	
        	<input value="0" name="item14" id="prz14SukkosInIsrael" type="hidden"> 
	
        	<input value="0" name="item15" id="prz15FillErUp" type="hidden"> 
	
        	<input value="0" name="item16" id="prz16Lishmah" type="hidden"> 
	
        	<input value="0" name="item17" id="prz17Leichter" type="hidden"> 
	
        	<input value="0" name="item18" id="prz18VacationAnywhere" type="hidden"> 
	
        	<input value="0" name="item19" id="prz19FiveLaptops" type="hidden"> 
	
        	<input value="0" name="item20" id="prz20DebtFree" type="hidden"> 
	
        	<input value="0" name="item21" id="prz21FiveishMobile" type="hidden"> 
	
        	<input value="0" name="item22" id="prz22ShoppingSpree" type="hidden"> 
	
        	<input value="0" name="item23" id="prz23ClassicJewelry" type="hidden"> 
	
        	<input value="0" name="item24" id="prz24PricelessBrocha" type="hidden"> 
	
        	<input value="0" name="item25" id="prz25MakeAWish" type="hidden"> 
	
        	<input value="0" name="item26" id="prz26CustomSheitel" type="hidden"> 
	
        	<input value="0" name="item27" id="prz27SavingsBond" type="hidden"> 
	
        	<input value="0" name="item28" id="prz28Artscroll" type="hidden"> 
	
        	<input value="0" name="item29" id="prz29AmazonGiftCard" type="hidden"> 
	
        	<input value="0" name="item30" id="prz30Jackpot" type="hidden"> 
	
<script>
function EditItem(id, field) {
	$('#'+field ).attr('readonly', false);
	$('#button' + id).removeClass('invisible');
				$('#edit' + id).addClass('invisible');

}

function removeItem(id, field) {
	 $('#'+field).val('0');
submitCart();
	$('#liList' + id ).remove();
//	document.getElementById(field).value = 0;
	
}
function CancelItem(id, field) {
			$('#'+field ).attr('readonly', true);
			$('#button' + id).addClass('invisible');
				$('#edit' + id).removeClass('invisible');

}
</script>

 
                    </ul>
                    <div class="summary"><span id="totalcost2" style="visibility:hidden;">0</span>
                        <table>
                            <tbody><tr>
                                <td class="label">Order Total:  </td>
                                <td class="figure">$<span id="totalcost">40</span></td>
                            </tr>
                            <tr>
                                <td>Tickets: </td>
                                <td><span id="totalTickets">19<br>
You got 3 free tickets.</span><span id="freeTicketString"></span> </td>
                            </tr>
                            <tr>
                                <td>Free Gifts: </td>
                                <td><span id="freegiftamt">0</span></td>
                            </tr>
                            <tr class="red">
                                <td>Million Dollar Raffle  </td>
                                <td>$<span id="winamount">40,000.00 (40*1000) </span></td>
                            </tr>


                        </tbody></table>

                    </div>

                </div>
                <div class="button-set">
                 <a href="prizes.asp">      <button class="continue yellow" type="button">
  <span>                   Continue Shopping &gt;</span>
                    </button></a>
                    <button class="next" data-id="choose-gift" type="button">
                        <span>next &gt;</span>
                    <a class="bx-next" href="">next &gt;</a></button>
                </div>
            </div></div></div><div class="bx-controls"></div></div>
        
        </div>
          
        </div></form>
               <footer>
  <div class="footer-container">
    <div class="box footer-logo"> <img src="images/footer-logo.png"> </div>
    <div class="box auction">
      <div class="box-title">
        <h3>AUCTION 2013</h3>
        <ul>
          <li><a href="#">How it works</a></li>
          <li><a href="#">Free Gifts</a></li>
          <li><a href="#">Shop Prizes</a></li>
          <li><a href="#">Terms</a></li>
        </ul>
      </div>
    </div>
    <div class="box contact">
      <div class="box-title">
        <h3>CONTACT US</h3>
        <ul>
          <li><a href="#">Call 1877-7-AUCTION</a></li>
          <li><a href="#">Email Us</a></li>
        </ul>
      </div>
    </div>
    <div class="box about">
      <div class="box-title ">
        <h3>READ MORE ABOUT OORAH</h3>
        <ul>
          <li><a href="#">The Oorah blog</a></li>
          <li><a href="#">Upcoming events</a></li>
          <li><a href="#">Our Programs</a></li>
        </ul>
      </div>
    </div>
    <div class="box social">
      <div class="box-title">
        <h3>Conect with us</h3>
        <ul>
          <li class="fb"><a href="#"><img src="images/social/facbook.png" alt="facebook"></a></li>
          <li class="twitter"><a href="#"><img src="images/social/twitter.png"></a></li>
          <li class="youtube"><a href="#"><img src="images/social/youtube.png"></a></li>
          <li class="gplus"><a href="#"><img src="images/social/gplus.png"></a></li>
        </ul>
      </div>
    </div>
    <div class="copy">
      <p>© Oorah, Inc. is a 501 (c)(3) tax exempt organization.</p>
    </div>
  </div>
</footer>
<!-- Google Code for Remarketing Tag -->
<!--------------------------------------------------
Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
--------------------------------------------------->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1026593605;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script><iframe name="google_conversion_frame" title="Google conversion frame" src="https://googleads.g.doubleclick.net/pagead/viewthroughconversion/1026593605/?random=1383601697045&amp;cv=7&amp;fst=1383601697045&amp;num=1&amp;fmt=1&amp;guid=ON&amp;u_h=1080&amp;u_w=1920&amp;u_ah=1040&amp;u_aw=1920&amp;u_cd=24&amp;u_his=34&amp;u_tz=-420&amp;u_java=true&amp;u_nplug=33&amp;u_nmime=116&amp;ref=https%3A//www.oorahauction.org/prizes.asp&amp;url=https%3A//www.oorahauction.org/checkout.asp&amp;frm=0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="13" scrolling="no" width="300"><img height="1" width="1" border="0" alt="" src="https://googleads.g.doubleclick.net/pagead/viewthroughconversion/1026593605/?frame=0&random=1383601697045&cv=7&fst=1383601697045&num=1&fmt=1&guid=ON&u_h=1080&u_w=1920&u_ah=1040&u_aw=1920&u_cd=24&u_his=34&u_tz=-420&u_java=true&u_nplug=33&u_nmime=116&ref=https%3A//www.oorahauction.org/prizes.asp&url=https%3A//www.oorahauction.org/checkout.asp&frm=0" /></iframe>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1026593605/?value=0&amp;guid=ON&amp;script=0"/>
</div>
</noscript>


</div>

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Can you post a link to the page, trying to debug 2000 lines of code by itself is not easy.
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
You have multiple elements with the same name e.g. this appears twice in your form

<input value="0" name="item30" id="prz30Jackpot" type="hidden">

p.s.
Since you are using jQuery why are you still using vanilla js
All the code you have like
document.form1.prz1EretzYisroel.value
could be written $("name").val() etc
0
 

Author Comment

by:rivkamak
Comment Utility
The multiple elements are being generated from that bxslider.
That's my problem.
How can I go around this?
My page is located here:
https://www.oorahauction.org/checkout.asp
but you will have to start one step before here and put something in your cart:
https://www.oorahauction.org/prizes.asp#
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Dunno, why would a slider be duplicating all your elements? Seems weird.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now