Skip to content

Instantly share code, notes, and snippets.

@vfontjr
Last active February 27, 2022 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vfontjr/c293d9467b3e0eada322a84dc407f709 to your computer and use it in GitHub Desktop.
Save vfontjr/c293d9467b3e0eada322a84dc407f709 to your computer and use it in GitHub Desktop.
<script>
jQuery(document).ready(function($) {
"use strict";
/* Format link phone number */
$("#field_devdir_country_code, #field_devdir_primary_contact_phone").on("change", function() {
var link_number = $("#field_devdir_country_code").val() + $("#field_devdir_primary_contact_phone").val();
$("#field_devdir_link_phone_number").val( link_number.replace(/\D/g,'') );
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment