Textarea repeat
jefflane - February 23, 2009 - 21:32
| Project: | AHAH helper |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Description
Using the ahah_helper_demo module, if you change a textfield to a textarea, the textarea will repeat itself when the ahah_helper_module is executed. You must have FCKeditor module installed/enabled to view this problem.
<?php
$form['billing_info']['company_name'] = array(
'#type' => 'textfield',
'#title' => t('Company name'),
'#required' => TRUE,
'#size' => 20,
'#maxlength' => 255,
// If the user switched to Private usage and back to Company usage, we
// remembered his company's name!
'#default_value' => $form_state['storage']['billing_info']['company_name'],
);
?>To
<?php
$form['billing_info']['company_name'] = array(
'#type' => 'textarea',
'#title' => t('Company name'),
'#required' => TRUE,
// If the user switched to Private usage and back to Company usage, we
// remembered his company's name!
'#default_value' => $form_state['storage']['billing_info']['company_name'],
);
?>
#1
I tried installing FCKeditor and the AHAH helper demo module, but I can't seem to reproduce this error.
Can you post a screenshot and the javascript inserted by FCKeditor?
#2
Attached is the screen shot. Note that I had to flip through the selection box to get ahah_helper active. Once flipped from private to company, the extra textarea appeared.
#3
applicable JS from Firebug
section 1
<script type="text/javascript" src="/tysite/misc/jquery.js?a"></script>23<script type="text/javascript" src="/tysite/misc/drupal.js?a"></script>
24<script type="text/javascript" defer="defer" src="/tysite/sites/all/modules/admin_menu/admin_menu.js?a"></script>
25<script type="text/javascript" src="/tysite/sites/all/modules/panels/js/panels.js?a"></script>
26<script type="text/javascript" src="/tysite/misc/jquery.form.js?a"></script>
27<script type="text/javascript" src="/tysite/misc/ahah.js?a"></script>
28<script type="text/javascript" src="/tysite/misc/textarea.js?a"></script>
29<script type="text/javascript" src="/tysite/sites/all/modules/ahah_helper/ahah_helper.js?a"></script>
30<script type="text/javascript">
31<!--//--><![CDATA[//><!--
32jQuery.extend(Drupal.settings, { "basePath": "/tysite/", "admin_menu": { "margin_top": 1 }, "ahah": { "edit-billing-info-usage": { "url": "/tysite/ahah_helper/billing_info", "event": "change", "keypress": null, "wrapper": "billing-info-wrapper", "selector": "#edit-billing-info-usage", "effect": "none", "method": "replace", "progress": { "type": "throbber" }, "button": false }, "edit-billing-info-vat": { "url": "/tysite/ahah_helper/billing_info%5D%5Bvat", "event": "blur", "keypress": null, "wrapper": "edit-billing-info-vat-wrapper", "selector": "#edit-billing-info-vat", "effect": "none", "method": "replace", "progress": { "type": "throbber" }, "button": false } } });
33//--><!]]>
34</script>
And section 2 (as opposed to pasting the whole file. I hope I am not missing anything...)
<div id="content">74 <div id="squeeze">
75 <h2 class="content-title">test</h2><form action="/tysite/ahah_helper_demo" accept-charset="UTF-8" method="post" id="ahah-helper-demo-form">
76<div><div id="billing-info-wrapper"><fieldset><legend>Billing information</legend><div class="top"><div class="bottom"><div class="bottom-ornament"><div class="form-item" id="edit-billing-info-usage-wrapper">
77 <label for="edit-billing-info-usage">Usage: </label>
78 <select name="billing_info[usage]" class="form-select" id="edit-billing-info-usage" ><option value="private">Private</option><option value="company" selected="selected">Company</option></select>
79</div>
80<input type="submit" name="op" id="edit-billing-info-update-usage" value="Update usage" class="form-submit no-js" />
81<div class="form-item" id="edit-billing-info-company-name-wrapper">
82 <label for="edit-billing-info-company-name">Company name: <span class="form-required" title="This field is required.">*</span></label>
83 <textarea cols="60" rows="5" name="billing_info[company_name]" id="edit-billing-info-company-name" class="form-textarea resizable required"></textarea>
84</div>
85<div class="form-item" id="edit-billing-info-vat-wrapper">
86 <label for="edit-billing-info-vat">VAT number: </label>
87 <input type="text" maxlength="255" name="billing_info[vat]" id="edit-billing-info-vat" size="20" value="" class="form-text" />
88 <div class="description">Please enter a Belgian VAT number, the format is: <em>BE0999999999</em>.</div>
89</div>
90<div class="form-item" id="edit-billing-info-address-wrapper">
91 <label for="edit-billing-info-address">Address: <span class="form-required" title="This field is required.">*</span></label>
92 <input type="text" maxlength="255" name="billing_info[address]" id="edit-billing-info-address" size="20" value="" class="form-text required" />
93</div>
94<div class="form-item" id="edit-billing-info-country-wrapper">
95 <label for="edit-billing-info-country">Country: </label>
96 <input type="text" maxlength="255" name="billing_info[country]" id="edit-billing-info-country" size="20" value="" class="form-text" />
97</div>
98</div></div></div></fieldset>
99</div><input type="submit" name="op" id="edit-save" value="Save" class="form-submit" />
100<input type="hidden" name="form_build_id" id="form-2165d443db68d98d22ec7e26fc6cbb18" value="form-2165d443db68d98d22ec7e26fc6cbb18" />
101<input type="hidden" name="form_token" id="edit-ahah-helper-demo-form-form-token" value="90ee817a0ca89dc472afb7ba16aa55e8" />
102<input type="hidden" name="form_id" id="edit-ahah-helper-demo-form" value="ahah_helper_demo_form" />
103
104</div></form>
105 </div>
106 </div> <!-- /content -->