I have a radio list which they select if they are going to upload or mail a photo and it only show the upload button if they select upload option. If they select mail and try to submit it, it gives and error that the upload field is required. All other conditionally mandatory fields I have seem to work fine.

Comments

stewest’s picture

I have the same issue.

All other mandatory conditional fields (all text fields) "work". My issue is that when one selects "No" to an option which otherwise would have mandatory file fields inside it (in my case a field group with two file fields required, when the user submits the form, they are presented with an error, stating that the mandatory file fields are required (Even though they said no to that conditional field).

Webform 6.x-3.11
Filefield 6.x-3.10
(jQuery update 6.x-1.1)

johnmcc’s picture

I have exactly the same issue as #1. The "required" attribute is not valid on file fields within the Drupal 6 forms API - I wonder if this is the cause.

weavie’s picture

subscribe

Domug’s picture

I have the same issue as #1 using 7.x-1.0-dev branch. Going to open an issue for that branch, too.

Marat’s picture

Version: 6.x-1.0-rc2 » 6.x-1.0

I have the same problem. It used to work before but don't know what happens!

roball’s picture

Version: 6.x-1.0 » 6.x-1.1
Priority: Normal » Major

Can confirm this bug with 6.x-1-1. sad to see that nobody cared about it yet, now since more than 2 years.

Milkrow’s picture

subscribe

roball’s picture

Issue summary: View changes

Problem still exists in latest stable D6 release (6.x-1.2). Is there intention to fix it?

roball’s picture

Version: 6.x-1.1 » 6.x-1.2
edhelll’s picture

Add this code to webform_conditional.module to function webform_conditional_element_after_build after line 216 ($form_element['#required'] = FALSE):


		foreach ($form_element as $key => $value) {
			if ($key[0] != '#' && $value['#type'] == 'file') {
				$form_element[$key]['#required'] = FALSE;
				foreach ($form_element[$key]['#element_validate'] as $key2 => $value2) {
					if ($value2 == '_webform_required_file' || $value2 == '_webform_required_multifile') {
						unset($form_element[$key]['#element_validate'][$key2]);
					}
				}
				break;
			}
		}
roball’s picture

Status: Active » Needs work

Thanks for your code. Could you please provide it as a patch against git's 6.x-1.x branch?