Add support for textareas

bjalford - July 18, 2009 - 08:30
Project:Compact Forms
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Using webform, all the other fields work fine but not text area.

See (message field): http://www.supermoves.co.uk/drupal/contact

Has anyone else had this issue?

#1

Laurent_ - August 4, 2009 - 12:15

Same issue
Subscribing

#2

sun - August 4, 2009 - 13:12
Title:textarea fields not working» Add support for textareas
Version:6.x-1.2» 6.x-1.x-dev
Category:bug report» feature request

As far as I can tell from the code, textareas were never supported.

However, adding support for them might be doable. Patches are welcome.

#3

Laurent_ - August 4, 2009 - 14:33

Hi

The following fix works for me :
compact_forms.js (line 17)
change
if ($field.attr('type') != 'text' && $field.attr('type') != 'password') {
into
if ($field.attr('type') != 'text' && $field.attr('type') != 'textarea' && $field.attr('type') != 'password') {

Regards

Laurent

#4

sun - August 5, 2009 - 20:33
Status:active» needs review

Sorry, I'd be really surprised when that works, because that's a bit nonsense.

$field.attr('type') != 'text' checks for the HTML attribute "type". Textareas do not have a "type" attribute. Instead, they are TEXTAREA elements and not INPUT elements.

Please test attached patch.

AttachmentSize
compact_forms-HEAD.textarea.patch 1.23 KB

#5

Laurent_ - August 6, 2009 - 07:18

Hi Sun

Your patch is also working fine.
Mine is working because a textarea is considered as text type (see 'Attributes' section in http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID...).

Thanks

Laurent

#6

sun - August 6, 2009 - 20:27
Status:needs review» fixed

Thanks for reporting, reviewing, and testing! Committed to all branches.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

#7

System Message - August 20, 2009 - 20:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.