0

Is there a way of customizing the errors Solspace freeform displays as it currently just says "Required field missing input". I would like to make the error a bit more explanatory. Also, as the website is in Italian, I would also like the error displayed to also be in Italian and not English. Is there somewhere where I can edit/customise this?

Edit 1/12/2018

I have not been able to get the {if freeform:errors} to work properly. I have added the code for my form below in case it helps.

{exp:freeform:composer form:id="reportForm" form:class="report-form" form_name="report_issue"}
  {composer:page}
    <form class="report-form" id="reportForm">
      <fieldset>
      <div class="general_errors"></div>
        {composer:rows}
          {composer:columns}
            {composer:fields}
              {if composer:field_label}
                {if composer:field_type == 'nonfield_captcha'}
                  {if freeform:captcha}
                  <p>
                    <strong>{composer:field_label}</strong>
                  </p>
                  {/if}
                {if:else}
                  <label class="field_label" {if composer:field_name != ''}for="freeform_{composer:field_name}"{/if}>
                    {composer:field_label}{if composer:field_required}<span class="required_item">*</span>{/if}
                  </label>
                {/if}
              {/if}
              {if composer:field_output}
                {if composer:field_type == 'nonfield_title'}
                  <legend>{composer:field_output}</legend>
                {if:elseif composer:field_type == 'nonfield_paragraph'}
                  {composer:field_output}
                {if:elseif composer:field_name == 'indirizzo_url'}
                  <input type="text" name="indirizzo_url" value="{current_url}" id="freeform_indirizzo_url" maxlength="150">
                {if:elseif composer:field_type == 'nonfield_captcha'}
                  {if freeform:captcha}
                      {freeform:captcha}<br />
                      <input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" />
                  {/if}
                {if:else}
                  {composer:field_output}
                {/if}
              {/if}
              {if freeform:field_errors}
                <ul>
                  {if freeform:error:indirizzo_url}
                      <li>L'indirizzo della pagina (URL) è obbligatorio. Per piacere inserisci l'indirizzo del gioco in questione.</li>
                  {if:else}
                      <li>Messaggio obbligatorio. Per cortesia, indica il problema presente nel gioco in questione.</li>
                  {/if}
                </ul>
              {/if}
            {/composer:fields}
          {/composer:columns}
        {/composer:rows}
      </fieldset>
    </form>
  {/composer:page}
{/exp:freeform:composer}
4

Yes, you can customize the errors given by Solspace freeform. Please see below code to modify the errors. freeform:field_errors

{if freeform:field_errors}
    <h2>There were some error(s) with your submission:</h2>
    <ul>
    {if freeform:error:first_name}
        <li><b>First Name</b> is required.</li>
    {/if}
    {if freeform:error:last_name}
        <li><b>Last Name</b> is required.</li>
    {/if}
    {if freeform:error:email}
        <li><b>Email</b> is required.</li>
    {/if}
    </ul>
{/if}

I think, directly you can not convert errors in Italian language.

| improve this answer | |
  • Hi, thanks for this, I haven't been able to get it to work though, I am not sure if it is because my code is incorrect or if it is because I am using a ajax form. I have updated my question with the code from my form. – tcherokee Jan 12 '18 at 12:04
0

To help with the 2nd part of your question I offer the following:

We have a form that we present in English and in Spanish but we want to have all the data be submitted into the same place.

So for the Spanish version we translate the FreeForm field labels on the client side using jQuery like so:

$(document).ready(function() {
      $("label[for='freeform_first_name']").text( "Nombre *" );
      $("label[for='freeform_last_name']").text( "Apellido *" );
});

I expect you could adapt this technique to error handling as well.

We are using FreeForm 4 (older). Syntax may be different depending on your version.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.