Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
Hi Kit, Sounds like an interesting solution though I need a little more help in understanding your code, it may even warrant an entry on your blog :) –  nav Jan 25 '11 at 10:36
    
Yeah.. I left it pretty general since it is a lot of code. I can try to answer any specific question you have. :) I also currently use Prototype.js with a library I'm working on: sputility.codeplex.com –  Kit Menke Jan 25 '11 at 14:36

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

share|improve this answer
    
Very interesting link! I think this is basically what I ended up writing myself. :( –  Kit Menke Jan 25 '11 at 14:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.