Textarea default value cut off
Lappie - August 11, 2005 - 10:26
| Project: | Webform |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | ullgren |
| Status: | closed |
Jump to:
Description
Similar to the cut off issue with the confirmation field
I also find that for a textarea of let's say 50x5 the default value is cut off after the node/webform has been submitted.That is, if you create a webform with a textarea and enter a default text in that area that is longer than 128 characters, only the first 128 are displayed if a user calls the webform.

#1
I finally had some time to look into the issue and it indeed proved to be the same problem as for the confirmation cut off I reported a while ago for an earlier version of webform.
So, 'ALTER TABLE webform_component CHANGE value value text;' did the trick for me.
Now, whether this should be the default or not is perhaps open for discussion?! I ran into the problem when I noticed that the Descriptions cannot be of "infinite" length so I needed a different approach to place the long explanations that many of the fields in my form require(*).
For the specific textarea I just entered an example for the users as a default value. This example got cut off. With value being varchar(128) default values for regular textfield fields don't get into trouble but for a textarea field you'll notice.
So either we get (ahrum I know I know I know) more options to place explanations or just regular text in between the fields or perhaps, as an easier solution, make value a default of text.
(*) Perhaps this is an indication that I'm abusing webform? :)
#2
I was too quick with the previous solution. Other stuff needs to be done as well. In webform.module on around line 450 you will find the code
$rows[] = array(form_radio('', 'webform_checked_component', $key),
form_textfield('', "webformcomponents_name][".$key, $name, 20, 127),
$node->webformcomponents_type[$key],
form_textfield('', "webformcomponents_value][".$key,
$node->webformcomponents_value[$key], 20, 1024),
form_checkbox('', "webformcomponents_mandatory][".$key,
'1', ($node->webformcomponents_mandatory[$key]?1:0)),
Where the above fragment displays 1024, in the original webform code the value of 255 is set. Although you also have to change the database with the above fix, this needs to be a bigger value as well because else your text is still being cut off (only now at 255 characters).
#3
Thanks! This tricks saved me.
Ciao,
robepisc
#4
At last this is in the CVS
#5