Solved

CAML Query - People Picker Field - _ ALSO trigger when selection is made using SharePoint

Posted on 2015-02-02
1
415 Views
Last Modified: 2015-04-22
I am working with an SPServices call and CAM Query. Trying to do a filter against a value in a People Picker field in SharePoint 2007.

I am continually getting an error on the execution of the Query no matter how I set up the parameters for the People Picker field. Please advise what I need to change. I need to filter against the current value in the People Picker input area.

A second issue is that I can have the code trigger when a value is manually entered into the input area but it won't trigger if the actual People Picker is used.

here is current code

function EmployeeCheck() {	
    //Setting variables
		ShowDialog = false;
		

        EmployeeID = $('textarea[title="People Picker"]').val(); 

		//Setting the CAML query
  		SPCAMLQuery = '<Query><Where><And><And><Includes><FieldRef Name="Field_x0020_Employee_x0020_Name" /><Value Type="Text">' + EmployeeID + '</Value></Includes><Geq><FieldRef Name="Date_x0020_of_x0020_Observation" /><Value IncludeTimeValue="FALSE" Type="DateTime">2014-01-01</Value></Geq></And><IsNull><FieldRef Name="Observation_CanceledReason" /></IsNull></And></Where></Query>';
    

Open in new window

0
Comment
Question by:aehrenwo
1 Comment
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 40727274
Hi,
the people picker is quite tricky - as the HTML DOM beyond from what you see in the browser is quite complicated.
But the following should exactly retrieve the displayed value:
jQuery("textarea[title='People Picker']").closest("td").find("#content").text();

Open in new window

For the second issue:
How have you implemented the triggers?
But perhaps the second one is worth an additional question.

Thanks and HTH
Rainer
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question