SharePoint Person Column lookup check fails when I add some simple jquery to form
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]').chang开发者_Python百科e(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>
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/
jQuery.noConflicy();
jQuery('select[title$=Issue Type] option:eq(0)').text("Please Select").val("");
精彩评论