Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
截止日期后jQuery文本区域删除_Jquery_Coldfusion - Fatal编程技术网

截止日期后jQuery文本区域删除

截止日期后jQuery文本区域删除,jquery,coldfusion,Jquery,Coldfusion,我们公司最近在拼写检查器的截止日期后开始使用。我们喜欢它的功能,然而,我们基本上已经对它进行了破解,以便它能够在不同客户站点的每个页面上运行。长话短说,我最终使用jQuery在每个页面上应用拼写检查器 问题是,当您检查拼写并完成它时,如果您提交它,它不会通过post传递表单字段。我们正在运行Coldfusion,它只是说表单变量不存在 下面是代码,非常简单: function check(elId,linkId) { AtD.checkTextAreaCrossAJAX( el

我们公司最近在拼写检查器的截止日期后开始使用。我们喜欢它的功能,然而,我们基本上已经对它进行了破解,以便它能够在不同客户站点的每个页面上运行。长话短说,我最终使用jQuery在每个页面上应用拼写检查器

问题是,当您检查拼写并完成它时,如果您提交它,它不会通过post传递表单字段。我们正在运行Coldfusion,它只是说表单变量不存在

下面是代码,非常简单:

    function check(elId,linkId)
 {
    AtD.checkTextAreaCrossAJAX( elId , linkId, '<img src="http://www.curricunet.com/images/accept.png" />Finish Checking');
 };
函数检查(elId,linkId)
{
AtD.checkTextAreaCrossAJAX(elId,linkId,“完成检查”);
};
我认为他们提供的jQuery插件有问题。我一直在讨论他们的插件(在src文件夹中,他们有一个未统一的版本)。我似乎找不到问题。他们在他们的网站上没有很好的支持

你们能想出为什么要从表单中删除textarea吗

以下是我认为正在破坏代码的函数(至少在Firefox和Chrome中是这样):

AtD.restoreTextArea=函数(id){
var options=AtD.textareas[id];
/*检查我们是否处于校对模式,如果没有,请重新调整*/
if(options==未定义的| | options['before']==options['link'].html())
回来
/*清除预览div中的错误HTML*/
AtD.移除(id);
/*清除AtD同步字段*/
jQuery('#AtD#u sync').remove();
/*将preview div替换为textarea,注意我必须如何恢复相应的class/id/style属性*/
var含量;
如果(navigator.appName==“Microsoft Internet Explorer”)
content=jQuery('#'+id).html().replace(//gi,“\n”);
其他的
content=jQuery('#'+id).html();
jQuery('#'+id).replaceWith(选项['node']);
jQuery('\'+id).val(content.replace(/\<\;/g',).replace(/\&;/g',&');
jQuery('#'+id).height(选项['height']);
/*将链接文本更改回其原始标签*/
options['link'].html(options['before']);
};

在文本区域查看他们的演示

如果在Firebug中查看呈现的页面,当您单击拼写检查按钮时,textarea将被替换为一个可编辑的div和一个带有生成id的隐藏表单字段

<div contenteditable="true" id="textInput" style="height: 194px; overflow: auto; white-space: pre-wrap; outline: medium none; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-size: 16px; font-family: times; border: 1px solid rgb(0, 0, 0); text-align: start; margin: 2px; width: 394px; line-height: 20px; letter-spacing: normal; left: auto; right: auto; top: auto; bottom: auto; position: static; padding: 2px;" class="input" spellcheck="false">text</div>

<input type="hidden" id="AtD_sync_" value="The purpoce of a spell checker is to check the text four spelling and typeing errors. The checker finds errors througout the text. When the spell checker finds an questionable word, it highlights it and suggests the mpst likely variants too replace the questionable word. You can select the variant and replace the wrrd or leave the word unanged." name="">
文本

是否在未重新单击拼写检查按钮(将其返回文本区域)的情况下提交表单?这就解释了为什么该字段在POST上不存在。您可能需要模拟在表单的提交处理程序上转换回的逻辑

David,实际上我已经根据他们的示例在表单提交上进行了这样的设置。“我还是会出错的。”@Micharch54哦,我的错。你检查过它是否正确地被转换回正确的表单名称吗?是的,我最初让它显式地将东西重命名回它应该是什么,看看这是否解决了问题。然后,为了排除我的代码不是很差,我将其精简为基本函数(如上面所示)。它还在做。名称是正确的,只是没有与表单一起发布。即使我尝试序列化所有字段,它也不会出现。我不确定到底发生了什么。奇怪的是,这在InternetExplorer中运行良好。它只在Firefox和Chrome中爆炸(我假设Safari也是如此)。@Micharch54你能发布你正在使用的HTML/表单吗?叹气。。。我解决了这个问题。我们的一些开发人员正在将表单标记放在标记之间。当页面通过拼写检查刷新时,它会导致表单跳转到页面顶部。因此,其中没有字段。这就是为什么有编码标准是如此重要。谢谢你的帮助,大卫。
<div contenteditable="true" id="textInput" style="height: 194px; overflow: auto; white-space: pre-wrap; outline: medium none; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-size: 16px; font-family: times; border: 1px solid rgb(0, 0, 0); text-align: start; margin: 2px; width: 394px; line-height: 20px; letter-spacing: normal; left: auto; right: auto; top: auto; bottom: auto; position: static; padding: 2px;" class="input" spellcheck="false">text</div>

<input type="hidden" id="AtD_sync_" value="The purpoce of a spell checker is to check the text four spelling and typeing errors. The checker finds errors througout the text. When the spell checker finds an questionable word, it highlights it and suggests the mpst likely variants too replace the questionable word. You can select the variant and replace the wrrd or leave the word unanged." name="">