Actually this is possible by using the hook below. Add it to your functions.php file
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']==2991)
{
//check if featured image exists o
if (isset($fields['_featured_image']))
{
list($width, $height, $type, $attr) = getimagesize($fields['_featured_image']['field_data']['tmp_name']);
if ($width != 1220 && $height != 360) {
//set error message for featured image
$errors['_featured_image'] = 'Image size must be 1220 * 360, your image dimensions are '.$width.' * '.$height;
}
}
}
//return result
return array($fields,$errors);
}
Please try this and let me know if it helps. Also you need to replace the 2991 with the ID of your form.
Unfortunatly adding the code in child folder's function.php didnt work...
To make it more clear By default the multiline box shows only 5 rows on load.
Of course you can enlarge the box with the right bottom corner. (Check mini.jpg)
But It can be really cool if the multiline box could show 12-15 rows on page load.
I have setup many questions in this field and I would like some of them at least to be visible on page load... (Check maxi.jpg)
Dear Shane I am sorry 😀
I have wrote back to the wrong ticket 🙂
My reply is about the multiline row numbers... If you have any suggestions for that, it will be more than welcome too.
I will try that again for the files sizes and let you know...
E.
Hmm...
I have tried but it didnt work because my field is not featured image but "image".
Also there's one more thing...
I would like to setup the MAX and MIN image dimensions in PX : max-min height and max-min width if possible.
If I insert this code people will have to insert the exact image size and I am not sure they all know how to resize an image :/
It musnt refuse all image files that wont be very user friendly.
MAybe it is better to setup a limit for the image file size in kb ?
If you can suggest anything I'll give it a try.
Thanks.
Sorry for the delay in response as our forums are closed on the weekends.
Unfortunately with this code we can only do it for the image dimensions.
For the max and min dimensions I would recommend that you contact one of our contractors as this would require some amount of custom coding to achieve.
The code that I provide was a basic solution for the file image size but more modification would be needed in order to get exactly what you want which would be out of our support scope.