0

I'm working on a infopath form in Sharepoint 2010, and I need to add some JS goodness to the user experience.

The problem is, I believe the "webpart" that loads the infopath form is loaded dynamically, and I can't attach any jquery events to the contents of the form. I've already tried with "live".

The way I'm implementing the jQuery is by opening the form in Sharepoint Designer, allowing me to add a "content webpart" below the webpart that loads the infopath form. I load jQuery via googleapi, and I can work with the objects within this content webpart, but not matter what I do, I can't "reach" the content in the loaded infopath form?

Is there some magic jquery way of "listening" to a specific html element, and waiting for it to load, and then attach my event handlers and other jquery goodness?

I may just not understand what's going on, but it seems to me, like this should definitely be a possibility, as I can view the source after opening the form, and I can plainly see all the content right there, right above my script block in my content web part.

Dynde
  • 2,592
  • 4
  • 33
  • 56
  • You being able to see the code is a good start, the rest of us being able to see the relevant parts is even better! It sounds like what you want is event delegation, but you mentioned that using `.live()` didn't work; using `.on()` (jQuery 1.7+) or `.delegate()` (prior to 1.7) may work instead. Posting the HTML (from your browser, not any server-side code that generates it) and any existing jQuery code you have would give us a better indication. – Anthony Grist Apr 17 '12 at 12:39
  • I realize that it's difficult without source-code - but if you know sharepoint/infopath, you know that they tend to have the mindset of "the more the better" in regards to HTML/junk. I thought it would be tricky to find the relevant parts. However, you did put me on the right track, and I managed to find a solution - see my answer. – Dynde Apr 19 '12 at 08:58
  • What was your solution Dynde? I've so far been unsuccessful in preventing or circumventing the scroll position when transitioning views. I was hoping to attach a scrollto command after the form has completely loaded, but haven't had any luck. – Markus Mar 08 '13 at 17:05

0 Answers0