Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

ID of Lookup / Multi Picker Look up in Javascript

  Asked By: Faith    Date: Mar 07    Category: Sharepoint    Views: 2754

I have a Multi Picker Lookup field in my Custom List Form web part which
is in a Custom aspx page in Edit Item mode. I need to know how can I get the
client ID of this control in javascript?I tried using several techniques but
no use.



5 Answers Found

Answer #1    Answered By: Jocelyn Scott     Answered On: Mar 07

The cleanest way is going to be for you to get Control.ClientID on the
server side and then stick it into a literal or find some other way to
render it on the client. Failing that, you'll need to either (a) get all
elements of the same tag type using document.getElementsByTagName, and then
loop through until you find the one you want; or (b) use something like
jQuery to identify the element based on tag or class name.

Answer #2    Answered By: Gloria Mendoza     Answered On: Mar 07

Okay... maybe you should tell us what you actually want to do. Why do you
need a client ID? Since there are several, what is it that you need? If we
know your objective, we can help you toward the goal instead of banging our
heads against a wall.

Answer #3    Answered By: Harshad Jawalkar     Answered On: Mar 07

Is this the same request you posted under the subject: Validations in
Custom List Form Fields in SPD? What is the goal? I would suggest a jQuery
answer but I do not know if you are looking for this for that
RequiredFieldValidator question in the other post, for which jQuery would not be
a choice...

Answer #4    Answered By: Gyan Nene     Answered On: Mar 07

Infact, this requirement is also part  of the same Custom List Form that I
have. If we can achieve something with jQuery, why can't we achieve the same
thing through normal Javascript?

I believe I have explained my requirement very clearly. Please let
me know if u need more explanatation.

Didn't find what you were looking for? Find more on ID of Lookup / Multi Picker Look up in Javascript Or get search suggestion and latest updates.