0

All,

I'm sure this is simple to do, but I've been banging my head against the wall for awhile and still don't ahve the answer. I have a SharePoint form that has two People Picker objects on them, and I'd like to get the value for both of them.

Using JQuery, I can do $("textarea[title='People Picker']").val(), but that only gives me the value for the first control.

Is there a way to do something in JQuery like (using C# pseudo-code)

HTMLTags.Where(a => a.Type=="dr").Where(a => A.SubString("<nobr>Name of my People Picker") != null).Select(a => a.textarea.title="People Picker").First().val().

Basically, what I am trying to do in jQuery is get all DR elements, look for any elements that contain the Name of my People Picker text, and then go through the text of this datarow until I find the People Picker text area and then return that value.

Thanks.

EDIT: I'll add that while I know my way around C#, I'm still pretty new to js and jquery.

EDIT: Using SharePoint 2007. Supposed to upgrade to SharePoint 2010 by early next year.

William
  • 551
  • 2
  • 10
  • 24
  • So you want to iterate through the textareas until you find one that contains a substring? – James G. Aug 29 '14 at 00:01
  • what I want to do is get the value from multiple people pickers where I am identifying each people picker based off of the contents in their associated tags. – William Aug 29 '14 at 00:02
  • are you really using SharePoint 2007? Can you verify please? because that will make a huge difference in the answer. – Brian Vanderbusch Aug 29 '14 at 00:02
  • Unfortunately, yes. We are supposed to upgrade later this year (or possibly early next year), so I guess I'll need both. – William Aug 29 '14 at 00:06

1 Answers1

0

This for first textarea

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

This for last textarea

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

This for second textarea

$("textarea[title='People Picker']:eq(1)").val();

This for third textarea

$("textarea[title='People Picker']:eq(2)").val();

etc

user3349436
  • 151
  • 5