문제

I'm using MOSS 2007 for the NewForm.aspx need to implement field logic i.e whether to show certain fields based on the values of preceding fields.

I have implemented a similar solution embedding a Content Editor Webpart within the NewForm.aspx and using JQuery to manipulate the form elements.

However this solution does not lend itself to my current scenario due to the number of fields which need to be referenced. It would make much more sense to somehow wrap div tags around the sections of the form I want to dynamically display rather then reference each field within that section individually. Does anyone have any suggestions?

Many Thanks

도움이 되었습니까?

해결책

I just got done doing something similar. We have a large list that we wanted to organize into sections. Since it sounds like you have a handle on the JavaScript, I'll give you the pseudocode:

create config JSON object defining sections and fields in each section
for each section
    create new TBODY tag in table.ms-formtable
    attach event handler to allow user to switch between sections
    for each field in section
        insert field into TBODY

Unfortunately, what I discovered is that IE 7 has a hard time doing all the DOM manipulation (moving the field rows into different TBODY tags). The list has over 100 fields so this adds 2-3 seconds worth of overhead to the page. It works quickly in Firefox or IE 8... but I guess it could also be my code.

다른 팁

Even if you used wrapping, you would need to tell for each field which section it belongs to.

There seems to be a couple solutions around (I haven't used them myself). See for example this recent one:

https://www.nothingbutsharepoint.com/sites/eusp/pages/tabs-for-sharepoint-forms.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top