Use SPJS-Lookup in a customized form

Forums SPJS-Lookup Use SPJS-Lookup in a customized form

Viewing 0 reply threads
  • Author
    • #6942
      Alexander Bautz

      I generally do not support customized forms, but here is an small example on how to use this specific solution in a customized form.

      The example is not from a SharePoint form, and it is super simple to give you an idea on how you can set it up.

      DISCLAIMER: I cannot give any real support on this solution when used on a customized form.

      Use this code example in a web part page in your SharePoint site, and ensure you understand the code before trying it in a customized SharePoint form.

      		<td valign="top">Field 1</td>
      		<td valign="top" class="ms-formbody" id="myfield1">
      			<input type="text">
      		<td valign="top">Field 2</td>
      		<td valign="top" class="ms-formbody" id="myfield2">
      			<input type="text">
      <script type="text/javascript" src="/DFFS/SPJS/jquery-1.11.1.min.js"></script>
      <script type="text/javascript" src="/DFFS/SPJS/SPJS-Utility/spjs-utility.js"></script>
      <script type="text/javascript" src="/DFFS/SPJS/SPJS_Lookup/SPJS-lookup.js"></script>
      <script type="text/javascript">
      spjs.lookup.intFields = function(){
      	var a = {};
      		a[] = this.parentNode;
      	}); = a;
      		"CAML":null, // If used, the rest of the filterObj settings are disregarded
      		"linkText":"Write your own value"
      		"linkText":"Add new item",
      		"saveNewItemText":"Save new item"

      The “magic” is done in the function “spjs.lookup.intFields” as this overrides the built in function in the spjs.lookup script.


Viewing 0 reply threads
  • You must be logged in to reply to this topic.