Re: Sharepoint List crop and post to other field...
- From: Beholder <vandensteen@xxxxxxxxx>
- Date: Tue, 11 Sep 2007 04:25:06 -0700
Can anyone make a suggestion on the above mentioned question/problem?
On 22 aug, 16:23, Beholder <vandenst...@xxxxxxxxx> wrote:
L.S.,
In WSS 2.0 (2003) we designed a newform.aspx for an Item List that
containes Title, Category, Lookup Category, and some other irrelevant
fields. The lookup field queries the category column of the list for
all values and a javascript strippes the double entries. This script
also posts the selected option from this lookup field back to the
category field. We use this script to achieve this:
<script type="text/javascript">
var N = new Object();
var S = document.forms[0].elements['urn:schemas-microsoft-
com:office:office#CatLookup'];
while (S.options.length) {
if (!N[S.options[0].text]) N[S.options[0].text] = S.options[0].value;
S.options[0] = null;}
for (i in N) S.options[S.length] = new Option(i,N[i]);
</script>
<script>
var CatLookup = document.getElementById('urn:schemas-microsoft-
com:office:office#CatLookup');
var Category = document.getElementById('urn:schemas-microsoft-
com:office:office#Category');
CatLookup.onchange = fixList;
function fixList() {
var x = document._ctl1.elements['urn:schemas-microsoft-
com:office:office#CatLookup'].options.selectedIndex;
Category.value = document._ctl1.elements['urn:schemas-microsoft-
com:office:office#CatLookup'].options[x].text;
}
</script>
In WSS 3.0 (2007) the URN:schemas-microsoft-com:office:office#...
references to fields no longer exist, but are now populated by dynamic
names that cannot be used in our script.
Does anybody have a solution or alteration on how to grab the values
from a lookup field, strip thee double entries and post the selection
from the lookup field to another field (category)?
We have exeperimented with document.getElementsByTagName(fieldType),
but have not found it to work.
Thanks for your efforts.
.
- Follow-Ups:
- Re: Sharepoint List crop and post to other field...
- From: Mike Walsh
- Re: Sharepoint List crop and post to other field...
- Prev by Date: Re: Repeat Question
- Next by Date: Re: Repeat Question
- Previous by thread: Repeat Question
- Next by thread: Re: Sharepoint List crop and post to other field...
- Index(es):
Relevant Pages
|