Re: Sharepoint List crop and post to other field...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • Re: Make a field lookup dependent on the value in another field of a record?
    ... i think you're correct in your basic grasp of how to use a lookup table via ... your form is based on tblA. ... > A lookup field in a table, based on another table, while it displays the ... > i'll do a quick setup and email it back so you can see how it's done. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Are lookup fields truly evil?
    ... with the related foreign keys in your ... lookup table, and Product.CategoryID is a lookup field. ... The Evils of Lookup Fields in Tables ...
    (comp.databases.ms-access)
  • Re: Are lookup fields truly evil?
    ... lookup table, and Product.CategoryID is a lookup field. ... Very bad design. ... The Evils of Lookup Fields in Tables ...
    (comp.databases.ms-access)
  • Re: Are Lookup Fields Really Evil?
    ... Lookup tables, referenced via combo boxes in forms is the ... Microsoft IT Academy Program Mentor ... A Lookup field in a table displays the looked-up value. ... If a combobox based on the lookup is used in a form, and a filter is ...
    (microsoft.public.access.gettingstarted)
  • Re: Confused about how to make subforms visible/invisible
    ... first, if you have a lookup field in a *table*, suggest you get rid of the ... lookup *in the table* - they cause a lot of problems. ... next, to hide/unhide a subform control in a mainform, you need to make sure ... Select Expression Builder ...
    (microsoft.public.access.forms)