https://ericrohloff.com/coffeecup/ccfor … /form.html
<script>
var jQ = $.noConflict(true);
// version 2
function Cap_Words(str)
{
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
jQ( document ).ready(function() {
jQ('input[name^="Name"]').on('keydown', function(event) {
jQ('input[name^="Name"]').each(function(){
if(jQ(this).val()!=''){
jQ(this).val(Cap_Words(jQ(this).val()));
}
});
});
jQ(':submit').hide();
jQ("input[name='human']").keyup(function(){
if (!jQ(this).val().match(/^[6]+$/) || jQ(this).val() == "") {
jQ(':submit').hide();
jQ(':submit').attr('disabled', 'disabled');
}else{
jQ(':submit').show('slow');
jQ(':submit').removeAttr('disabled');
}
});
jQ('input[name="PhoneNum"]').on("keyup paste change", 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));
});
jQ('input[name="human"]').on('blur', function() {
var Value = jQ(this).val();
if(Value == ''){Value='0';}
var Orig_t = jQ(this).next('span').text();
var New_Ent = Orig_t.slice(0, -1);
jQ(this).next('span').text(New_Ent+Value);
});
});</script>
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com