所以我正在使用Drupal,我有一个字段,它是一个textrea,启用了ckeditor。
由于某种原因,我无法获得更新textarea的jquery。如果我在该字段上禁用ckeditor,即它只显示未加载ckeditor的标准textarea,则以下代码有效。当我在此字段上重新启用ckeditor工具时,以下代码似乎对该字段无效。
我有什么想法可以让它发挥作用?我需要对我的代码进行哪些更改才能使ckeditor正常启用?
function updateAddressFields() {
if(place.opening_hours.weekday_text != undefined){
$('#edit-field-operation-hours-0-value').val('');
for (i = 0; i < place.opening_hours.weekday_text.length; i++) {
var temp = place.opening_hours.weekday_text[i] + '\n';
var curValue = $('#edit-field-operation-hours-0-value').val();
var newValue = curValue + temp;
$('#edit-field-operation-hours-0-value').val(newValue);
}
}
}
这是我在字段上启用CKeditor时加载的HTML源代码的副本:
<div class="form-item" id="edit-field-operation-hours-0-value-wrapper">
<label for="edit-field-operation-hours-0-value">Operation Hours: </label>
<textarea cols="60" rows="5" name="field_operation_hours[0][value]" id="edit-field-operation-hours-0-value" class="form-textarea resizable ckeditor-mod"></textarea>
</div>
<div class="textarea-identifier description">CKEditor: the ID for <a href="/admin/settings/ckeditor">excluding or including</a> this element is <em>newsflash:world_listing@node/add/world-listing.edit-field-operation-hours-0-value</em>.</div><ul class="tips"><li>Allowed HTML tags: <ul> <ol> <li> <dl> <dt> <dd> <p> <br></li><li>Lines and paragraphs break automatically.</li></ul><p><a href="/filter/tips">More information about formatting options</a></p></fieldset>
答案 0 :(得分:1)
我很确定ckeditor用它自己的字段替换你的textarea。加载ckeditor时尝试检查字段,看看它是否仍然具有您期望的选择器。