Show a field twice in a form
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.
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.
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.
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.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests