Are you human? - Page 1 - Post ID 285067

User 2902462 Photo


Registered User
45 posts

Eric you wrote a code to hide the submit button until they answer the question with the number 6. This was for Form Builder. I'm trying to use Form Designer now. I tried to use this code but nothing happens.
Form Builder answer is (name human) and answer is 6
Form Designer answer is (name human) and answer 6
Submit button is (name submit) no value.
Can you help with this
David Doyle
User 187934 Photo


Senior Advisor
20,239 posts

Hi David,
You would need some custom Jquery script. If you can share your form I can take a look.
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

I'm sorry but how do I share my form?
David Doyle
User 187934 Photo


Senior Advisor
20,239 posts

Share a link to it or the fdp file
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

this is a link to the new form file
http://telgogolf.coffeecup.com/my%2Dforms/contact Form/form.html
and also
http://www.telgogolf.com/contact.html
Where is the .fb file
David Doyle
User 187934 Photo


Senior Advisor
20,239 posts

Sorry meant fdp file.:D
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

Is this what you need?
https://ericrohloff.com/coffeecup/ccfor … /form.html
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

Yes that Is it. how do I get the code?
David Doyle
User 187934 Photo


Senior Advisor
20,239 posts

Give this a try.
This replaces all of those scripts you have to streamline the script.;)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var jQ = $.noConflict(true);
// version 1
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));
});
});</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
User 2902462 Photo


Registered User
45 posts

Yes this works. I thank you very much. There is one other script that when the user types in the answer and it is wrong the error message pops up and says ( NO 3 times 2 does not = Here is where your code would put the answer that the user typed in ).
David Doyle

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.