unlcms / UNL-CMS

Drupal 7 implementation at the University of Nebraska–Lincoln
http://unlcms.unl.edu/
GNU General Public License v2.0
4 stars 13 forks source link

Webform number field validator error #913

Closed ericras closed 5 years ago

ericras commented 8 years ago

Hello! In webaudit, I got the error "Attribute “step” not allowed on element “input” at this point."  I don't have anything typed in the Step field. How to fix? Thanks. Sorry, that's in a webform, where I'm not sure how/if I can even fix this.

https://github.com/unlcms/UNL-CMS/blob/c18b5d3476c11d9c0cce8e4b9f8c0ba92bd89a71/sites/all/modules/webform/components/number.inc#L241

mfairchild365 commented 8 years ago

It looks like the number type was dropped to better handle internationalization (comma vs period for decimal). Browsers have had a bad time with this but appear to be getting better. This webforms issue summarizes the issue well (and references some workarounds) https://www.drupal.org/node/2543632

Personally, I think we should make every effort to follow the standards to the letter, however this is one of those rare gray areas where there are legitimate reasons to not follow the standard.

I see a few possible solutions that are unl-cms specific

  1. Force the use of the number type (either by un-commenting the code or by using some sort of hook). I might be wrong, but it looks like this was a recent change deployed to the cms and the number type was used before. We haven't heard reports of issues with the number type before, so for our uses it is probably okay to continue using it.
  2. Modify webforms so that it doesn't use the step attribute (and other number only attributes) on text fields and use data- attributes instead. This would be a lot of work and is probably not worth it.

I'm curious what you think @ericras

mfairchild365 commented 7 years ago

@ericras should we uncomment the override on this?