sergioC-13
In den letzten 30 Tagen erstellte Support-Threads: 0
Lieblings-Forenthemen
This user has no favorite topics.
Forum Topics Created
| Status | Thema | Supporter | Stimmen | Artikel | Aktualität |
|---|---|---|---|---|---|
|
custom field type file validation
Gestartet von: sergioC-13
in: Toolset Professional Support
Problem: I am having an issue with restricting file types to PDF and DOCX in a custom form on my WordPress website. The file type validation code I am using does not seem to work. Solution: Go to the Form edit screen and uncheck "Use the WordPress Media Library manager for image, video, audio, or file fields". Then, use the following code snippet by adding it to your theme's functions.php file or a custom plugin:
add_filter('cred_form_validate', 'cred_filetype_size_validation', 10, 2);
function cred_filetype_size_validation($field_data, $form_data) {
list($fields, $errors) = $field_data;
if (14 == $form_data['id']) {
$file_type_uploaded = $_FILES['wpcf-documento-obra-escritor']['type'];
if (!('application/pdf' == $file_type_uploaded) || ($file_type_uploaded == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')) {
$errors['documento-obra-escritor'] = 'Sorry, the file you have uploaded is not of the correct type.';
}
}
return array($fields, $errors);
}
Make sure to replace 14 with your form's actual ID. Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate |
|
2 | 7 | vor 3 years | |
|
html toolset forms reset after update
Gestartet von: sergioC-13 in: Toolset Professional Support |
2 | 3 | vor 3 years, 1 month | ||
|
issue with a index in multilang page
Gestartet von: sergioC-13 in: Toolset Professional Support |
|
3 | 7 | vor 3 years, 7 months | |
|
Getting constantly errors in the editor side as "invalid Json"
Gestartet von: sergioC-13 in: Toolset Professional Support |
|
2 | 3 | vor 3 years, 7 months | |
|
wpv-reset-password-form shortcode
Gestartet von: sergioC-13 in: Toolset Professional Support |
|
2 | 3 | vor 3 years, 9 months | |
|
error trying to save changes in the "No items found text" in the views
Gestartet von: sergioC-13 in: Toolset Professional Support |
|
2 | 8 | vor 3 years, 9 months | |
|
Save user data in a CPT after edit profile using Cred forms
Gestartet von: sergioC-13 in: Toolset Professional Support |
|
2 | 3 | vor 3 years, 10 months |