Lookup with free form text.

rss

Posted by ds4be - Mar 22 ’16 at 01:16

Hi

Can you advise if the following is possible.

 

I have a lookup column that links to a table with several statements, I would like the user to be able to select one or more of the statements, however I would like them to be able to add free form text?

I was hoping that a button with code can be used to Add the statements to a multitext field and then reset the lookup field at the same time or on closure of the form.

  • rostislav
    rostislav
    Moderator
    Member for: 7 years 10 days
    #1 by rostislav Mar 23 ’16 at 05:56

    Hi,

    You can use the 'Add new item' button option. Please check this page: http://spform.com/lookup

    The option is available if you go to "Manage Plumsail Lookups" -> tick "Add 'New Item' link".

     

     

  • ds4be
    Member
    Member for: 7 years 6 months 8 days
    #2 by ds4be Mar 23 ’16 at 09:07

    I would prefer it if they were not allowe to add to the lookup list as this will become an uncontrolled list quickly.

     

    Is there a way of selecting the data in the lookup (multiple values) and copying it to a multiline text field?

  • rostislav
    rostislav
    Moderator
    Member for: 7 years 10 days
    #3 by rostislav Mar 23 ’16 at 09:21

    [#2]:

    Sorry, it seems I didn't get your request at first. You want to copy the value of a CSL field into a text field via a button click it seems. For that:

    1. Add a button to the form

    2. Use its onclick attribute to add code

    3. See here what code you need to add exactly: http://formsdesigner.blogspot.com/2013/04/getting-and-setting-sharepoint-form.html

  • ds4be
    Member
    Member for: 7 years 6 months 8 days
    #4 by ds4be Mar 23 ’16 at 10:54

    Thanks.

    Is it possible to remove all the items selected in the look up field?

  • rostislav
    rostislav
    Moderator
    Member for: 7 years 10 days
    #5 by rostislav Mar 23 ’16 at 11:51

    [#4]:

    Remove from where? If you want to clear the CSL field, you can simply set the value of it to an empty array:

    fd.field('CrossSiteLookup').value([]) 

    If you want to remove them from the multiline text field you were talking about, you'll have to get the value of the field, parse it somehow (depending on how you were adding those values in the first place) into an array, remove the appropriate entries, parse back into a string and set the field.

  • ds4be
    Member
    Member for: 7 years 6 months 8 days
    #6 by ds4be Mar 23 ’16 at 12:03

    Hi

     

    Yes I want to set the native sharepoint lookup field to null / remove all selections.

     

    I tried the supplied code however it does not remove all the items.

  • rostislav
    rostislav
    Moderator
    Member for: 7 years 10 days
    #7 by rostislav Mar 23 ’16 at 12:18

    [#6]:

    Try this ('lkp' is an example internal name)

    fd.field('lkp').control()._el().find('select:eq(1) option').prop('selected', true);
    fd.field('lkp').control()._el().find('button:eq(1)').click(); 
  • ds4be
    Member
    Member for: 7 years 6 months 8 days
    #8 by ds4be Mar 24 ’16 at 04:53

    Thanks!

Displaying 1 to 8 of 8 messages