30 Posts
phil03
9 years ago
1
Topic

Hi,

When the file upload field is required.
No control is done and the validation is made without any warning.
In the file plugins / cck_field_validation / required / required.php


public static function onCCK_Field_ValidationPrepareStore (& $ field, $ name, $ value, and $ config)
if ($ value! = '' || $ field-> state == 'disabled' || strpos ($ field-> required, '[')! == false)


The condition $ field-> state == 'disabled' and prevents the error test.

For information in the Before Render 'state' = 1 instead of disabled.


How to solve this problem?

Thanks.

Get a VIP membership
7 years ago
0
Level 1

Hi Phil03,

I think the best way to control an upload is to use Js.

To do this, you've to add a little Js function into your upload file.

I've linked a tutorial wich will help you to do this.

Don't hesitate to come back to us if you have questions or if it doesn't work.

Good continuation and happy new year.

Ness

Get a Book for SEBLOD