We use Infopath 2007 + Sharepoint 2007 and need to inject some javascript to infopath form. I know that infopath form can be hosted on the aspx page using XmlFormControl. But this solution doesn't suit us =(. Is there any workaround?
Asked
Active
Viewed 6,973 times
6
-
We even tried to write javascript directly to view(.xsl) file. But after rendering xsn to html all our "extra" javascipt was removed. – Andrei Schneider Sep 29 '10 at 12:37
-
Probably not going to happen (at least without extreme effort). What are you trying to accomplish - perhaps we can find another way to do it. Some type of validation, perhaps? – Patrick Pitre Dec 20 '11 at 05:25
2 Answers
1
InfoPath Form Services won't let you publish an InfoPath form with JavaScript. If you really need to use JavaScript for a rich client experience, you may have luck loading your form in a XmlFormControl as you mentioned, then loading your js library on the page along side it, and binding to dom elements. You won't get any design time support this way but it may work.
Generally speaking, you need to stick to rules and managed code with IPFS.

pnewhook
- 4,048
- 2
- 31
- 49
0
Maybe you can write an InfoPath add-in to inject javascript codes.
InfoJet Service - InfoPath Web Forms Engine http://www.infojetsoft.com
-
I suppose such an add-in will be only able to add javascript to the view. But this script will be skipped by a render (Infopath Form Services are a render in my case). Am I right? BTW development of an add-in is a challenge. I can do any modification of the xsn file if it helps... – Andrei Schneider Sep 29 '10 at 14:49