当我向表单添加一些简单的 jquery 时,SharePoint 人员列查找检查失败
我有一个共享点列表表单,已作为自定义添加模式重新插入到页面中。该列表有一个人员选择器人员类型列。该表单工作得很好,直到我添加一些 jquery 代码来默认另一个下拉列。现在,当我在人员列中输入姓名并按 Enter 键时,它永远不会返回下划线来确认人员有效 - 我只是得到处理图标。这是 jquery 代码,否则可以正常工作。我们在 MOSS 2007 SP2
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$('select[title$=Issue Type] option:eq(0)').text("Please Select").val("");
</script>
noconflicity() 更改后的完整代码块:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery('select[title$=Issue Type] option:eq(0)').text("Please Select").val("");
$('select[title$=Issue Type]').change(function(){
var issue = $('select[title$=Issue Type] :selected').text();
var bodyprefixes = [];
$('#issuetbl td:contains('+issue+')').nextAll().each(function(i, k) {
bodyprefixes.push($(k).html().replace(/DIV/g,"\n").replace(/ /g,"\n").replace(/<[^>]+>/g, ""));
});
$('input[title$=Subject]').val(bodyprefixes[1]);
$('textarea[title$=Message]').val(bodyprefixes[0]);
});
</script>
I have a sharePoint list form I've reinserted into a page as custom add mode. That list has a people picker person type column. the form works great until I add some jquery code to default another another dropdown column. Now the when I enter a name into the person column and hit enter it never return an underline to confirm person is valid - i just get the processing icon. Here's the jquery code which otherwise works. We are on MOSS 2007 SP2
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$('select[title$=Issue Type] option:eq(0)').text("Please Select").val("");
</script>
Full code block after noconflicity() change :
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery('select[title$=Issue Type] option:eq(0)').text("Please Select").val("");
$('select[title$=Issue Type]').change(function(){
var issue = $('select[title$=Issue Type] :selected').text();
var bodyprefixes = [];
$('#issuetbl td:contains('+issue+')').nextAll().each(function(i, k) {
bodyprefixes.push($(k).html().replace(/DIV/g,"\n").replace(/ /g,"\n").replace(/<[^>]+>/g, ""));
});
$('input[title$=Subject]').val(bodyprefixes[1]);
$('textarea[title$=Message]').val(bodyprefixes[0]);
});
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的猜测是 jQuery 对 $ 的使用与 SharePoint 正在做的事情发生冲突。为什么不尝试一下 jQuery 的 noConflict 模式: http://api.jquery.com/jQuery.noConflict /
My guess is jQuery's use of the $ is colliding with something SharePoint is doing. Why don't you try the jQuery's noConflict mode: http://api.jquery.com/jQuery.noConflict/