This is the source code of an address field from address field module. I'm not sure why there is a 0 in the size field (may be a bug), but should we fix such issues here?
Validation error:
line 248 column 131 - Error: Bad value 0 for attribute size on element select: Zero is not a positive integer.
Code example:
<select size="0" name="field_address[und][0][country]" id="edit-field-address-und-0-country" class="country form-select required ajax-processed">
<option value="AF">Afghanistan</option><option value="AX">Aland Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
</select>
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | addressfield-select_size_value_0-1812080-3.patch | 464 bytes | goron |
| #2 | addressfield-select_size_value_0-1812080-2.patch | 429 bytes | goron |
Comments
Comment #1
hass commentedMoving to Address Field as I have found that a value of
0is invalid per API docs http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc...Per http://www.quackit.com/html_5/tags/html_select_tag.cfm
Comment #2
goron commentedI encountered this too. It can be a problem when formatting select elements, for instance with formalize.css.
This patch fixes the issue. Just removed one line. I'm not sure why that line was there in the first place, doesn't seem like it's needed for anything.
Comment #3
goron commentedI see now that the line was there to "cancel" the #size property that may have been set before on the element. But it should be unset rather than zeroed. Here's a new patch.
Comment #4
hass commentedGreat that you found the reason for this line. We should add a short comment about the reason.
Comment #5
rszrama commentedCommitted with comments. Thanks!
Commit: http://drupalcode.org/project/addressfield.git/commitdiff/efba8b0cdb9d83...