Skip to content

Instantly share code, notes, and snippets.

@apih
Last active October 16, 2018 08:49
Show Gist options
  • Save apih/27f092c4f2d21147b44d0dce351b745f to your computer and use it in GitHub Desktop.
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
<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