Show a field twice in a form

rss

Posted by haasha - Apr 18 ’16 at 07:46

We would like a field appears twice in a form, in a header and also in a tab.

Is that possible?

 

i.e.

 

Num:

Customer:

Status:

 

TAB Detail

Description

Source

Type

...

 

TAB Customer details

Customer (same field than header):

Address:

...

 

 

  • Sonoma
    Member
    Member for: 4 years 10 months 24 days
    #1 by Sonoma Apr 18 ’16 at 09:41

    You could try something like this.

     

    Create a div and append to it. I needed to seperate a checkbox over 3 table rows. Each row and column had to represent different fields but the Main column was the left column. It was the type. I set my table up as normal.

    Then created a div for the left column for each result I had in my multiple choice check box.

    <tr><td><div id="EGRF"></div>

    <tr><td><div id="ALK"></div>

    <tr><td><div id="KRAS"></div>

     

    Looks like this in the html:

    <table class="fd_table " style="width: 100%;"><tbody><tr><td class="my-table" style="padding: 5px; width: 25%;">

     

    <b>Biomarker</b>

    </td><td class="my-table" style="padding: 5px; width: 25%;">

     

    <b>Undocumented</b>

    </td><td class="my-table" style="padding: 5px; width: 25%;">

     

    <b>Date of Test</b><br>(MM/DD/YYYY)

    </td><td class="my-table" style="padding: 5px; width: 25%;">

     

    <b>Test Result</b>

    </td></tr><tr><td class="my-table" style="padding: 5px; width: 25%;">

     

    <div id="EGRF"><span title="EGRF" class="ms-RadioText"><input...BiomarkerField_ctl00_ctl00">EGRF</label></span></div>

    ...     //omitted

    <div id="ALK"><span title="ALK" class="ms-RadioText"><input

    ...     //omitted

    <div id="KRAS"><span title="KRAS" class="ms-RadioText"><input

    ...   //omitted

    for="ctl00_ctl34_g_43184330_c5a8_4a08_9b5d_5735b26eca9f_KRAS2ResultField_ctl00_ctl02">Undocumented</label></span></td></tr></tbody></table></span></div></div></td></tr></tbody></table>

     

     

    The code behind:

    var Biomarker_options = fd.field('Biomarker').control()._el().find('td'); //Find the field if listbox/multi choice

    $(Biomarker_options.eq(0).html()).appendTo('#EGRF'); // Append the field to your div. This is my example. You would put your field here.

    $(Biomarker_options.eq(1).html()).appendTo('#ALK');

    $(Biomarker_options.eq(2).html()).appendTo('#KRAS');

    $('.Biomarker-field').hide();  //In my case I hid the original field. But if unhidden I would have twice the field, one together and one seperated.

     

    I have over 200 forms. The user want them to look like the word document and use the logic and flow. I have to get creative. This may be more or less what you needed but I thought I would share it.

    Good luck.

     

     

     

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 3 months 14 days
    #2 by rostislav Apr 18 ’16 at 10:35

    [#1]:

    Would that be for a display form or for an edit/new item form?

  • Sonoma
    Member
    Member for: 4 years 10 months 24 days
    #3 by Sonoma Apr 18 ’16 at 12:51

    [#2]: I use it in both. That is if it is not the main ID. that is tricky in the NEW form since it does not exist until you save.

     

    But you may need to do it a little different in the display form depending on how your out come is. You may get undefined. Tha just means SP displays the field with a diffenert name. I typically on use jquery in the display form for label minuplation or anything that does not require field data.

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 3 months 14 days
    #4 by rostislav Apr 19 ’16 at 08:04

    [#3]:

    Anyway, to the OP. If you want this for the display form you can simply insert a text or a rich text control and add a field name in square brackets to it, e.g.

    [Title] - this will display the contents of Title.

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 3 months 14 days
    #5 by rostislav Apr 19 ’16 at 08:06

    [#4]:

    Check http://formsdesigner.blogspot.com/2013/12/customization-of-toolbar-buttons-and.html

  • Sonoma
    Member
    Member for: 4 years 10 months 24 days
    #6 by Sonoma Apr 19 ’16 at 08:34

    [#4]: That is the other way. It slipped my mind for the moment. Thanks.

  • Sonoma
    Member
    Member for: 4 years 10 months 24 days
    #7 by Sonoma Apr 28 ’16 at 08:09

    I ran into a problem with my solution. Maybe someone can enlighten me. It is probably something simple.

    It works great for selecting an option but unselecting does not work so well.

    Any ideas how I can unselect a selected DIV?

     

    Thanks.

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 3 months 14 days
    #8 by rostislav Apr 28 ’16 at 08:16

    [#7]: How are you selecting the div?

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 3 months 14 days
    #9 by rostislav Apr 28 ’16 at 08:16

    The message was removed by a forum moderator.

  • Sonoma
    Member
    Member for: 4 years 10 months 24 days
    #10 by Sonoma May 2 ’16 at 10:42

    [#8]: Since I hide the control I use the cloned controls.

Displaying 1 to 10 of 10 messages