Change field labels based on Dropdown

Forums Dynamic Forms for SharePoint Change field labels based on Dropdown

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 1 year, 5 months ago.

  • Author
    Posts
  • #10504

    avala
    Participant

    Alexander,

    Looking for a custom function compatible with DFFS and vLookup that would change field labels based on a value I’m passing from the parent item to the child item.

    For example, if I pass the value “New Job” into the Request Type field my visible fields would read Start Date, End Date, Task Manager, and Client Contact. If I pass the value “Revised Task” into the Request Type field, I want my visible fields to read Revised Start Date, Revised End Date, Revised Manager, etc.

    See screenshots below.

  • #10601

    Alexander Bautz
    Keymaster

    Hi,
    I don’t have a function in DFFS that does this, but you can do it like this in a custom function in the Custom JS textarea:

    Use this line to change the label of a SBS field – “FieldNumber1” is the FieldInternalName:

    $("#sbs_FieldLabel_FieldNumber1").find(".ms-standardheader").text("test");

    Use this to set the label of a standard field not in SBS configuration:

    $("#dffs_FieldNumber1").find(".ms-standardheader").text("test");

    If you pass this key in the URL from the vLookup “prefill value in child”

    FieldNumber1=New label

    you can use this code to set the value:

    $("#sbs_FieldLabel_FieldNumber1").find(".ms-standardheader").text(GetUrlKeyValue("FieldNumber1"));

    Hope this helps,
    Alexander

    • This reply was modified 1 year, 5 months ago by  Alexander Bautz. Reason: Fixed typo in field name

You must be logged in to reply to this topic.