I'm trying to remove the "size" attribute from Drupal's FileField
output. Right now, it outputs a tag like this:
<input type="file" name="files[image]" class="form-file" id="edit-image" size="40" />
I tried a number of permutations of using unset()
in a #pre_render
callback in my custom module, but I just wind up with size="". The attribute itself never goes away, so HTML5 validators continue to complain. Is there another way to accomplish this, or a way to truly ensure that your callback runs last? $form['mystuff'][] = 'mycallback'
is not doing the trick, and plain old unset($form['mystuff']['#size'])
runs far too late.