spjs-lookup ID Value

Forums SPJS-Lookup spjs-lookup ID Value

Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #23281
      Wilson
      Participant

      Hi Alexander,
      How can I retrieve the corresponding ID for the item selected with spjs-lookup?

      Thanks

    • #23285
      Alexander Bautz
      Keymaster

      Hi,
      If you inspect the <option> of the <select> you will find the value attribute has the ID of the list item.

      You would have to use custom code (for example in dffs_PreSaveAction) to get the ID and write it to another field. You should be able to use code like this (written directly here so I haven’t tested it):

      var selectedID = jQuery("#dffs_YourFieldInternalNameHere select").val();
      setFieldValue("TheFieldYouWantToSaveTheIdIn",selectedID);

      Alexander

Viewing 1 reply thread
  • You must be logged in to reply to this topic.