Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Add to List if not in Drop Down

$
0
0

Not sure this is helpful since "view source" doesn't seem to show the Title's of the inputs

 
<tdvalign="top"class="ms-formbody"><!-- FieldName="Plans"
			 FieldInternalName="Plans"
			 FieldType="SPFieldLookupMulti"
		  --><spandir="none"><inputid="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker"name="ctl00$m$g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f$ctl00$ctl05$ctl44$ctl00$ctl00$ctl04$ctl00$ctl00$MultiLookupPicker"type="hidden"></input><inputid="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_data"name="ctl00$m$g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f$ctl00$ctl05$ctl44$ctl00$ctl00$ctl04$ctl00$ctl00$MultiLookupPicker$data"type="hidden" value=*REMOVED TO CONDENSE*></input><input id="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_initial"name="ctl00$m$g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f$ctl00$ctl05$ctl44$ctl00$ctl00$ctl04$ctl00$ctl00$MultiLookupPicker$initial"type="hidden"value="*Removed for condensing*"></input><tableclass="ms-long"cellpadding="0"cellspacing="0"border="0"><tr><tdclass="ms-input"><selectname="ctl00$m$g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f$ctl00$ctl05$ctl44$ctl00$ctl00$ctl04$ctl00$ctl00$SelectCandidate"id="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_SelectCandidate"multiple="multiple"title="Plans possible values"onchange="GipSelectCandidateItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);"ondblclick="GipAddSelectedItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false"style="width:143px;height:125px;overflow:scroll;"></select></td><tdstyle="padding-left:10px"><tdalign="center"valign="middle"class="ms-input"><buttonid="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_AddButton"class="ms-ButtonHeightWidth"onclick="GipAddSelectedItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false"> Add ></button><br/><br/><buttonid="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_RemoveButton"class="ms-ButtonHeightWidth"onclick="GipRemoveSelectedItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false">< Remove </button></td><tdstyle="padding-left:10px"><tdclass="ms-input"><selectname="ctl00$m$g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f$ctl00$ctl05$ctl44$ctl00$ctl00$ctl04$ctl00$ctl00$SelectResult"id="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_SelectResult"multiple="multiple"title="Plans selected values"onchange="GipSelectResultItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);"ondblclick="GipRemoveSelectedItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false"style="width:143px;height:125px;overflow:scroll;"></select></td>

Here is the code from pressing F12,

<selectname="ctl00$m$g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f$ctl00$ctl05$ctl44$ctl00$ctl00$ctl04$ctl00$ctl00$SelectResult"title="Plans selected values"id="ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_SelectResult"style="width: 250px; height: 125px; overflow: scroll;"ondblclick="GipRemoveSelectedItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false"onchange="GipSelectResultItems(ctl00_m_g_c76eb6da_9e12_4b19_8eee_80863f9f7c2f_ctl00_ctl05_ctl44_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);"multiple="multiple">

As you can see, it has the title as "Plans selected values"

For the "addVendor" function you wrote, I am using the method provided to put a link directly into the form. It is actually using the same "select[title=" that your new code uses. The following works fine in my form.

$("select[title='Plans selected values']").parents("td.ms-formbody").append("Add New Plan");
});

So why does this code work using the $("select[title='Plans selected values']"). but the other doesnt?


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>