Are you human? - Post ID 285488

User 187934 Photo


Senior Advisor
20,239 posts

What kind of phone are you using?
I can't hear what I'm looking at.
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
User 2902462 Photo


Registered User
45 posts

GalaxyS5 Samsung
David Doyle
User 283347 Photo


Registered User
388 posts

David Doyle wrote:
Hello Eric
I have an issue with the code when I tested the forms on my cell phone. After typing 2 letters they will repeat.
Like TE when you type the next letter you get TETE
www.telgogolf.com/contact.html
Any ideas


Seems to work correctly for me... Pixel 2 XL just fyi
User 187934 Photo


Senior Advisor
20,239 posts

It works for me on my Iphone. Which script is working incorrectly? The Capitalize one?
I can't hear what I'm looking at.
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
User 187934 Photo


Senior Advisor
20,239 posts

Give this a try.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var jQ = $.noConflict(true);
// version 4
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"], input[name="Contact"], input[name^="P"], input[name="First-N"],input[name="Last-N"],input[name="City"]').on('keydown', function(event) {

if(jQ(this).val()!=''){
jQ(this).val(Cap_Words(jQ(this).val()));
}

});
jQ(':submit').attr('disabled', 'disabled');

jQ("input[name='human']").keyup(function(){

if (!jQ(this).val().match(/^[6]+$/) || jQ(this).val() == "") {
jQ(':submit').attr('disabled', 'disabled');
}else{
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);
});

jQ('input[name="Company"]').keyup(function() {
jQ(this).val(jQ(this).val().toUpperCase());
});


});
</script>
I can't hear what I'm looking at.
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

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.