How to hide Purchase order Product from email

  • Profile Image
    RACRUSWAL
    Asked on January 17, 2014 at 09:32 AM

    Thanks for your all fabulous support in the past - I'm really hoping you can help me out with my latest little problem.

    I have used the folllowing code to style the form and to hide the check-box. As you will see in the form url below and have added a zero quantity to the dropdown qty field.

     

    My problem is: When the user changes the qty field and then decides they don't want the product and changes it back to zero - the product appears on the email submission with a 0 price and a 0 quantity.  This has become an issue with my client and the people that are entering the orders.  This only happens when a user adjusts the quantity field.

    Is there some css code that I can inject into the form styles area or place in the html on the email notification that could hide the product and description if the quantity or price is equal to 0.

     

    I really hope you can help.

    Thanks so much,

    Rachelle

     

    .form-product-item br

    {

    display:none;

    }.form-product-item

    {

    width:800px

    }.form-product-item .form-sub-label-container

    {

    float:left;

    }

    .form-product-item br

    {

    display:none;

    }.form-product-item

    {

    width:800px

    }.form-product-item .form-sub-label-container

    {

    float:left;

    }

    #input_440_1003.form-checkbox{display: none !important;

    }

    #input_440_1006.form-checkbox{display: none !important;

    }

  • Profile Image
    RACRUSWAL
    Answered on January 18, 2014 at 05:09 AM

    Hi Ardy,

    You helped me out before with some Javascript thank you so much!

    The link to the form on my server is http://electronic-specialist.co.uk/FormsArea/form/form.html

    It is important for my client to have no checkbox.  Could you show me how to create the javascript to detect the quantity as 0.

    Thanks so much :-)

    Rachelle

  • Profile Image
    Cesar
    Answered on January 18, 2014 at 11:58 AM

    Thank you for your input. On behalf of my colleague once he has an update on what has been previously discussed. He will let you know through this thread. Thank you

  • Profile Image
    RACRUSWAL
    Answered on January 19, 2014 at 08:04 AM

    Thans so much Cesar

  • Profile Image
    RACRUSWAL
    Answered on January 21, 2014 at 09:14 AM

    Hi Guys,

    You helped me out before with some Javascript thank you so much! 

    The link to the form on my server is http://electronic-specialist.co.uk/FormsArea/form/form.html

    It is important for my client to have no checkbox.  Could you show me how to create the javascript to detect the quantity as 0.

    Thanks so much :-)

    Rachelle

  • Profile Image
    RACRUSWAL
    Answered on January 21, 2014 at 11:01 AM

    Absolutely no problem Ardy thank for your time and attention.

    Rachelle :-)

  • Profile Image
    RACRUSWAL
    Answered on January 22, 2014 at 04:32 AM

    Hi Ardy,

    I have:

    Cloned your form:

    http://form.jotformpro.com/form/40211783851956

    Then clicked Embed - Source.  I copied the source code into TextWrangler.  

    I then added at the head:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <html>

    <head>

      <title>Form</title>

     

    I then added near the top of the form ( this code adds the extra fields to the purchase order total):

    <script>

    var dynPOTotal = parseFloat(0);

    function checkPOTotal(){

    dynPOTotal = parseFloat(document.getElementById("payment_total").innerHTML);

    calculateNewTotal();

    }

    function calculateNewTotal(){

     var POTotal = parseFloat(document.getElementById("payment_total").innerHTML);

     if(dynPOTotal != POTotal){

    POTotal = dynPOTotal;

     }

     var Price1 = parseFloat(document.getElementById("input_332").value);

     if(!Price1){

      Price1 = parseFloat(0);

     }

     var Price2 = parseFloat(document.getElementById("input_453").value);

     if(!Price2){

      Price2 = parseFloat(0);

     }

    var Price3 = parseFloat(document.getElementById("input_457").value);

    if(!Price3){

      Price3 = parseFloat(0);

     }

    var Price4 = parseFloat(document.getElementById("input_478").value);

    if(!Price4){

      Price4 = parseFloat(0);

     }

     var DiscountAmt = parseFloat(document.getElementById("input_446").value);

     if(!DiscountAmt){

      DiscountAmt = parseFloat(0);

     }

    var FinalTotal = POTotal + Price1 + Price2 + Price3 + Price4;

    if(FinalTotal == 0.0){

    FinalTotal = 0.0;

     

    }else{

    FinalTotal = FinalTotal - DiscountAmt;

    }

    var controlFTotal = document.getElementById("input_447");

    controlFTotal.value = parseFloat(FinalTotal).toFixed(2);

     

     

     

     

     

    }

    </script>

    I added at the bottom of the form:
      <script>setInterval(function(){checkPOTotal()},1000);</script>
    </form>
    </body>
    </html>
    I then added your new code from the url bellow before the end of the </form>
    http://pastie.org/pastes/8654218/text
    Here is the url: http://www.electronic-specialist.co.uk/FormsArea/newform.html
    I have checked the email submissions and the 0 quantity items are still appearing see screen shot.  
    It is important to my client that no checkboxes appear on the form  
    What have I done wrong?  
    clip
    Thanks,
    Rachelle
  • Profile Image
    NeilVicente
    Answered on January 22, 2014 at 07:10 AM

    Rachelle,

    I have relayed your message to Ardy so he can help you resolve this problem of yours. He will attend to you when he becomes available.

    Cheers!

  • Profile Image
    RACRUSWAL
    Answered on January 26, 2014 at 08:36 AM

    Hi Ardy,

    I am really sorry for the confusion.  

    You are correct in saying that the products that have never been selected do not appear on the form, however if a user changes the quantity from 0  to 1 (or any other quantity) and then decides that they dont actuaually want to purchase the product so they change it back to zero, Its only then that the product description and 0 total appear on the submission.  I understand that the check boxes are to stop that from happening but in this case I cant have checkboxes.

    My original question is still - What javascript can I add to the form to stop the 0 quantity Products appearing on the form  submission when on submission the Purchase Order quantities are set to 0.

    My appologies again if I was not clear.

    Thanks for your timew and attention,

    Rachelle

  • Profile Image
    RACRUSWAL
    Answered on January 27, 2014 at 02:35 PM

    Hi Ardy,

    Thank you so much!  Works Fantastic!

    :-) Rachelle