Solved

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

Posted on 2015-02-02
1
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Jquery form 9 39
jQuery Toggle & Anchor Links 5 55
jquery not working after div reload 4 32
links not working 2 25
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
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…
The viewer will learn how to dynamically set the form action using jQuery.
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…

740 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