Last active
October 16, 2018 08:49
-
-
Save apih/27f092c4f2d21147b44d0dce351b745f to your computer and use it in GitHub Desktop.
JS code for using input type number element for quantity in OnPay form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Use input type number element for quantity | |
$("[name^='product_quantities']").each(function() { | |
var element = $(this); | |
element.replaceWith('<input type="number" class="form-control quantity" min="0" name="' + element.prop("name") + '" value="' + element.prop("value") + '">'); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment