Jump to content

need help customizing the error code in forms 7.1

Recommended Posts

Site URL: https://www.elizabundledee.com/

 

Hi! We would like to customize the wording that appears when the error message pops up in a form. So when someone does not enter all the required info, we would like to put in a message that is more on brand for us than what currently appears. For example, we would like for this message to appear"Oops! It looks like you missed a step, beautiful one. Please enter your name and email address to receive your sacred gift."  I have searched the Forum and all over the internet and can not find the answer to this one. Anyone have a solution for this? 

Link to comment
  • Replies 5
  • Views 682
  • Created
  • Last Reply

Top Posters In This Topic

On 2/14/2022 at 12:12 PM, jenneb said:

Thanks tuanphan. I have tried that and it did not work for me.  I am a newbie so it is possible that there is something that I do not understand about those instructions but I could not make work. 

In the code you will see some english text - french text. Just change it.

If it still doesn't work, paste the code you used here, we will check it again

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...

I have the same problem. When pasting the code on square space it flairs an error on line1 ("Syntax Error On Line 1)". Is this because I am on basic plan? 

This is the code I am using....I just need to change one line 

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script type="text/javascript">

var formposted=0;

// Form error message translation. 
// Enter your English error messages here (don't forget full stop at end of message)
var errorEN = [
'Seu formulário encontrou um problema. Role para baixo para revisá-lo.'
];


//Enter your translated error messages here in the same order as above
var errorTR = [
'Erro - Verifique novamente o formulário.'
];


$(document).ready(function(){
    $('input.button, .lightbox-handle').click(function() {
        formposted=0;
        window.setInterval(errTranslate, 100);
    });
});

function errTranslate(){
    if(($(".field-error").is(':visible')) && (formposted==0)){
        $( ".field-error" ).each(function() {
            var errorText = $( this ).text();
            var numItems =  errorTR.length;
            for ( var i = 0; i < numItems; i++ ) {
                if (errorText == errorEN[i]) {$( this).text(errorTR[i] )};
            }
        });
        formposted = 1; 
    }
};
 

Edited by VPerfeito
Link to comment
On 3/5/2022 at 7:29 PM, VPerfeito said:

I have the same problem. When pasting the code on square space it flairs an error on line1 ("Syntax Error On Line 1)". Is this because I am on basic plan? 

This is the code I am using....I just need to change one line 

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script type="text/javascript">

var formposted=0;

// Form error message translation. 
// Enter your English error messages here (don't forget full stop at end of message)
var errorEN = [
'Seu formulário encontrou um problema. Role para baixo para revisá-lo.'
];


//Enter your translated error messages here in the same order as above
var errorTR = [
'Erro - Verifique novamente o formulário.'
];


$(document).ready(function(){
    $('input.button, .lightbox-handle').click(function() {
        formposted=0;
        window.setInterval(errTranslate, 100);
    });
});

function errTranslate(){
    if(($(".field-error").is(':visible')) && (formposted==0)){
        $( ".field-error" ).each(function() {
            var errorText = $( this ).text();
            var numItems =  errorTR.length;
            for ( var i = 0; i < numItems; i++ ) {
                if (errorText == errorEN[i]) {$( this).text(errorTR[i] )};
            }
        });
        formposted = 1; 
    }
};
 

The code is JavaScript, you need to add it to Settings > Advanced > code Injection > Footer

It looks like you added to Design > Custom CSS so it shows error

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.