w3c validation errors due to 'required' attribute on input type select #141

Closed
takaltoo opened this Issue Dec 9, 2010 · 6 comments

Comments

Projects
None yet
2 participants
@takaltoo

takaltoo commented Dec 9, 2010

The w3c validator (http://validator.w3.org/#validate_by_input) raises the following error on a form generated using simple_form:

Line 15, Column 123: Attribute required not allowed on element select at this point.

The form snippet causing the issue is given below:

square thumbnail

According to: (http://www.w3schools.com/html5/html5_form_attributes.asp) the required attribute only works with the following types: text, search, url, telephone, email, password, date pickers, number, checkbox, radio, and file

Using the "required" attribute on the select tags raises a w3c error.

The simple_form code used to generate the display_size:

f.input :display_size, :collection => @photo.possible_sizes, :prompt => 'Please select size'

@carlosantoniodasilva

This comment has been minimized.

Show comment Hide comment
@carlosantoniodasilva

carlosantoniodasilva Dec 9, 2010

Collaborator

Hey, you're right, I've totally missed that. I'll try to take a look at fixing this soon. Thanks.

Collaborator

carlosantoniodasilva commented Dec 9, 2010

Hey, you're right, I've totally missed that. I'll try to take a look at fixing this soon. Thanks.

@takaltoo

This comment has been minimized.

Show comment Hide comment
@takaltoo

takaltoo Dec 9, 2010

Thanks for the quick reply. Your plugin makes it much simpler in dealing with the nasty details of HTML forms.

takaltoo commented Dec 9, 2010

Thanks for the quick reply. Your plugin makes it much simpler in dealing with the nasty details of HTML forms.

@carlosantoniodasilva

This comment has been minimized.

Show comment Hide comment
@carlosantoniodasilva

carlosantoniodasilva Dec 10, 2010

Collaborator

Only add the "required" HTML 5 attribute for valid inputs, disable in selects (not allowed). Closed by bc2f3e7

Collaborator

carlosantoniodasilva commented Dec 10, 2010

Only add the "required" HTML 5 attribute for valid inputs, disable in selects (not allowed). Closed by bc2f3e7

@carlosantoniodasilva

This comment has been minimized.

Show comment Hide comment
@carlosantoniodasilva

carlosantoniodasilva Dec 10, 2010

Collaborator

Hey mate, I've pushed a fix to master branch, could you please do another test to see how it goes? Thanks.

Collaborator

carlosantoniodasilva commented Dec 10, 2010

Hey mate, I've pushed a fix to master branch, could you please do another test to see how it goes? Thanks.

@takaltoo

This comment has been minimized.

Show comment Hide comment
@takaltoo

takaltoo Dec 11, 2010

Thanks for the fix. Using the master branch all of my pages now pass the w3c validator. The required attribute issue no longer appears.

Thanks for the fix. Using the master branch all of my pages now pass the w3c validator. The required attribute issue no longer appears.

@carlosantoniodasilva

This comment has been minimized.

Show comment Hide comment
@carlosantoniodasilva

carlosantoniodasilva Dec 11, 2010

Collaborator

Cool, thanks for reporting back.

Collaborator

carlosantoniodasilva commented Dec 11, 2010

Cool, thanks for reporting back.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment