Skip to content

Instantly share code, notes, and snippets.

@tiagomatos
Last active December 8, 2017 01:11
Show Gist options
  • Save tiagomatos/cf8e7544500a5bd4e776cd5e079e8c16 to your computer and use it in GitHub Desktop.
Save tiagomatos/cf8e7544500a5bd4e776cd5e079e8c16 to your computer and use it in GitHub Desktop.
Validate Chilean RUT in HTML5 (input pattern) - Jumpseller
<script type="text/javascript">
$(document).ready(function(){
$("#order_shipping_address_taxid").attr("pattern", "[0-9]{7,8}-[0-9Kk]{1}"); // with . and . [0-9]{1,2}.[0-9]{3}.[0-9]{3}-[0-9Kk]{1}
$("#order_shipping_address_taxid").attr("placeholder", "12345678-5");
$("#order_shipping_address_taxid").attr("title", "ej. 12345678-5");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment