From: Anthony Talarico Date: Mon, 24 Oct 2016 18:58:51 +0000 (-0400) Subject: adding js to the token order form in gravity forms for the shipping for tokens only X-Git-Tag: v1.0.0^2~9 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=d0e97ac434c9744a1f8d436578b3537b6eb44c17;p=WP-Themes%2Fmackinacbridge.git adding js to the token order form in gravity forms for the shipping for tokens only --- diff --git a/js/app.js b/js/app.js index 373cadd..5bb0526 100644 --- a/js/app.js +++ b/js/app.js @@ -78,10 +78,19 @@ $(document).ready(function () { } } } - if( qty_total < 5 ){ - + if( qty_total < 5 && qty_total > 0 ){ + $("#ginput_quantity_4_48").val( 1 ); + $("#ginput_quantity_4_49").val( 0 ); + $("#ginput_quantity_4_50").val( 0 ); + } else if( qty_total < 11 && qty_total > 4 ){ + $("#ginput_quantity_4_48").val( 0 ); + $("#ginput_quantity_4_49").val( 1 ); + $("#ginput_quantity_4_50").val( 0 ); + } else if( qty_total < 31 && qty_total > 10 ){ + $("#ginput_quantity_4_48").val( 0 ); + $("#ginput_quantity_4_49").val( 0 ); + $("#ginput_quantity_4_50").val( 1); } - console.log(qty_total); }); @@ -99,5 +108,5 @@ $(document).ready(function () { $("#field_4_50").css({"visibility": "hidden", "height" : 0}); $("#input_4_41").attr("readonly", true); - $("#input_4_47").attr("readonly", true); + $("#input_4_47").attr("readonly", true); }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 977cc64..70a1d37 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -69,10 +69,19 @@ $(document).ready(function () { } } } - if( qty_total < 5 ){ - + if( qty_total < 5 && qty_total > 0 ){ + $("#ginput_quantity_4_48").val( 1 ); + $("#ginput_quantity_4_49").val( 0 ); + $("#ginput_quantity_4_50").val( 0 ); + } else if( qty_total < 11 && qty_total > 4 ){ + $("#ginput_quantity_4_48").val( 0 ); + $("#ginput_quantity_4_49").val( 1 ); + $("#ginput_quantity_4_50").val( 0 ); + } else if( qty_total < 31 && qty_total > 10 ){ + $("#ginput_quantity_4_48").val( 0 ); + $("#ginput_quantity_4_49").val( 0 ); + $("#ginput_quantity_4_50").val( 1); } - console.log(qty_total); }); @@ -90,5 +99,5 @@ $(document).ready(function () { $("#field_4_50").css({"visibility": "hidden", "height" : 0}); $("#input_4_41").attr("readonly", true); - $("#input_4_47").attr("readonly", true); + $("#input_4_47").attr("readonly", true); });