Hi, I don´t know if this is the best approach, but with new dev version of Webform, Compact Form does not work with email input fields, because of the new HTML5 support.

I´ve changed compact_form.js at line 21 from:
if (!$field.length || !$field.is('input:text,input:password,textarea')) {

to:
if (!$field.length || !$field.is('input:text,input:password,textarea, [type=email], [type=tel], [type=url], [type=number], [type=range], [type=date], [type=time], [type=datetime], [type=datetime-local], [type=month], [type=week], [type=color], [type=search]')) {

and it solved the problem. What do you think?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

laraz’s picture

I use your solution. thanks.

DrupalKing’s picture

Worked for me too

rimen’s picture

I used this solution for some types like search and other. You list more complete.
Thanks!

grasmash’s picture

This change worked for me as well.

ShaneOnABike’s picture

Status: Active » Needs review
FileSize
766 bytes

Wow! Great work I pushed that into a proper patch and attached that here for people to apply appropriate. Would be great if we could deploy this in the module to be used.

ShaneOnABike’s picture

Status: Needs review » Patch (to be ported)
yannickoo’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Patch works fine so let's mark this as RTBC.

BWPanda’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
805 bytes

The patch from #5 is back-to-front; it removes the new code and adds the old...
Here's an updated patch to fix that.

ckrina’s picture

Status: Needs review » Reviewed & tested by the community

The #8 patch aplied cleanly for me on dev version. Thanks!

xurizaemon’s picture

This is good IMO. Duplicated @ #1459346: Email labels in Webform 3.16+ not processed by compact form but the fix there is not as complete as this, so this should be backported IMO.

yannickoo’s picture

ancym’s picture

Status: Reviewed & tested by the community » Needs work

Any other progress with this?

Couldn't apply the patch in #8 against the 7.x-1.0+3-dev release from sept 30,2013. (Error was something like Hunk Fail line 18.)

When I tried to manually edit compact_forms.js, the user login block, which had been correctly displayed via compact forms, went back to its original state. The line to modify has been revised from that mentioned in #8 to

line 20
if (!$field.length || !$field.is('input:text,input:password,textarea,input[type=email]')) {

Note, used simplecorp theme since user login wasn't displaying compact-ly for other themes I tried (bamboo, openframework). Didn't work for webform in any of the themes I tried - perhaps a config error, tho i tried to include it for webform_client_form and for webform_client_form_nid.

Looks great when it works! Would love to have a working version.

(edit: The dev version is working for user login block for skeleton and simplecorp themes. No luck with Webform 7.x-3.19.)

FiNeX’s picture

Hi, I've just wrote a similar patch to fix this problem. I've not tested with webforms but with core node edit form it works fine.

ancym’s picture

Issue summary: View changes

Yeah, manually changed compact_forms.js according to patch in #8 and works perfectly in webform, great & thanks!

edit: went back and checked and the dev version of compact_forms.js works as is...
(helps to have the correct css id for the webform, oops and sorry for any confusion)

xurizaemon’s picture

Status: Needs work » Reviewed & tested by the community

@ancym, Drush applies the patch to current 7.x-1.x-dev for me. In Drush makefile we have

projects[compact_forms][version] = 1.x-dev
projects[compact_forms][patch][1405834] = https://drupal.org/files/html5_fields-1405834-8.patch

Setting back to RTBC (status previous to #12) since I can't reproduce the issue mentioned above

➜  1405834  drush make https://gist.github.com/xurizaemon/8411713/raw/acaa068c8aa42e1ad8f37b37f6dacf23ca6d31f8/gistfile1.txt
Make new site in the current directory? (y/n): y
Beginning to build                                                   [ok]
https://gist.github.com/xurizaemon/8411713/raw/acaa068c8aa42e1ad8f37b37f6dacf23ca6d31f8/gistfile1.txt.
drupal-7.25 downloaded.                                              [ok]
compact_forms-7.x-1.x-dev downloaded.                                [ok]
compact_forms patched with html5_fields-1405834-8.patch.             [ok]
Generated PATCHES.txt file for compact_forms                         [ok]

If anyone *can* repro that or (better) can repro it *and* update the patch resolving the issue you're experiencing, that would be much appreciated.

mErilainen’s picture

Works fine, please commit

unknownterritory’s picture

FileSize
900 bytes

Available patches do not play well with drush make as it adds automatically drupal's packaging information. The packaging info changes line numbering thus rendering the patches unusable. More info.
Uploading a patch created against a working copy of the module downloaded with the packaging info included in order to allow patch referencing in drush make files. This patch is otherwise in all things an exact copy of #8 : html5_fields-1405834-8.patch.

firewaller’s picture

Patch #8 still works for me. Can this get committed?