10

Is there a way to add either Javascript or additional css rules to InfoPath forms that are generated by the forms server in SharePoint 2010 or 2013?

  • I can recommend you Forms Designer (spform.com) tool. It allows to create custom forms with your own javascript and css directly in the browser. But it's not free. – Dmitry Kozlov Jan 29 '13 at 8:59
8

As a side-off note, Infopath 2003 used JS for code-behind though probably it wouldn't help you in any way since, I guess, you one should understand that Infopath forms are not HTML or web pages, they are XML data to be used by external tools, like for example Sharepoint Server IPFS - Infopath Forms Service, to generate web pages on the basis of XSN Infopath form template, while the data, in case of sharepoint library Infopath forms, is stored in Infopath XML data forms.

Please check:

If to guess a little further what you rellay ask and go outside of OOTB then you might find helpful:

Is there a way to add either Javascript or additional css rules to InfoPath forms that are generated by the forms server in SharePoint 2010 or 2013?

As it was answered before, it is possible to use C# or VB.NET in Infopath 2010 or 2013, unless it is Sharepoint List Form type where code-behind is not possible at all, and one cannot add OOTB CSS rules neither to Infopath XML data forms not to XSN Infopath form templates.

If you want to go non-OOTB and unintended ways, please check:

And if to go in intended and unproblematic way, then check:

6

If you are using a browser-based form you can only edit the form code using C# .NET or VB .NET. In InfoPath 2010, there should be a "Developer" tab where you can edit the code (using the "Code Editor" button). If you have to use Javascript, you could also try to call the script indirectly, using the method here:

http://blogs.msdn.com/b/infopath/archive/2005/06/17/430347.aspx

But you should review your requirements to see if Javascript is necessary and if you can't do the same with the OOTB methods.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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