I'm not having any luck with the multiple phone number setup.
Names are "phone1" & "phone2"
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script>var jQ = $.noConflict(true);
// version 1
jQ( document ).ready(function() {
jQ('input[name^="phone"]').on("keyup paste", function() {
var input = this.value.replace(/[^0-9\(\)\s\-]/g, "");
var inputlen = input.length;
var numbers = this.value.replace(/\D/g,'');
var numberslen = numbers.length;
var newval = "";
for(var i=0;i<numberslen;i++){
if(i==0) newval="("+numbers[i];
else if(i==3) newval+=") "+numbers[i];
else if(i==6) newval+="-"+numbers[i];
else newval+=numbers[i];
}
if(inputlen>=1&&numberslen==0&&input[0]=="(") newval="(";
else if(inputlen>=6&&numberslen==3&&input[4]==")"&&input[5]==" ") newval+=") ";
else if(inputlen>=5&&numberslen==3&&input[4]==")") newval+=")";
else if(inputlen>=6&&numberslen==3&&input[5]==" ") newval+=" ";
else if(inputlen>=10&&numberslen==6&&input[9]=="-") newval+="-";
jQ(this).val(newval.substring(0,14));
});
});</script>
Thank you,
Randy G