Skip Navigation

[Resuelto] Cred_form_validate not firing on edit form

This support ticket is created hace 6 años, 2 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: ,

Este tema contiene 6 respuestas, tiene 2 mensajes.

Última actualización por Shane hace 6 años, 2 meses.

Asistido por: Shane.

Autor
Mensajes
#1106814

I am trying to: I have some validating to do with some custom coding and I am using this hook to check one of the fields against something before submission.

Link to a page where the issue can be seen: Local Development, including duplicator package.

I expected to see:
The hook firing upon edit form submission

Instead, I got:
nothing

#1106832

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Zachary,

Thank you for contacting our support forum.

Could you let me know which Form is having the issue with the validation hook so that I can take a look at it ?

Thanks,
Shane

#1106847

Any edit of the moldflow submission forms were not firing the cred_form_validate hook. The one I was specifically playing with was cred form validate test 2. From the my account page is a link to view submissions. Then the links and edit links are there.

#1106851

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Zachary,

I tried downloading the duplicator package but its not working.

Would you mind providing me with access to the site so that I can have a look ?

Thanks,
Shane

#1106852

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Zachary,

I was able to get the duplicator to download, however i'm not seeing a Validation hook in the functions.php file of the theme.

Could you let me know where the hook is ?

Thanks,
Shane

#1106898
#1106899

I set it up on a staging enviroment. In order to even see the post links and edit links you will need to login with credentials on the live staging site.

#1106902

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Zachary,

From what I see the hook isn't targetting a specific form.

Could you add an if statement so that its for a specific form like our example here ?

add_filter('cred_form_ajax_upload_validate','my_validation',10,2);
function my_validation($error_fields, $form_data)
{
    //field data are field values and errors
    list($fields,$errors)=$error_fields;
    //validate if specific form
    if ($form_data['id']==62)
    {
        //check if featured image exists o
        if ($fields['_featured_image']['field_data']['size'] > 1000000)
        {
            //set error message for featured image
            $errors['_featured_image'] = 'Wrong size image';
        }
    }
    //return result
    return array($fields,$errors);
}

Thanks,
Shane