Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 828853 - Last Review: October 23, 2006 - Revision: 1.3
How To: Change the Script Language for Your InfoPath Form
This article describes how to change the script language for your InfoPath form template.
If you have already started Microsoft Script Editor for a form template, you can only change the script language by first removing the existing script from the form template. This article also describes how you can remove the script from your template so that you can change the script language.
Change the Script Language for Your Form Template
- Open your template in Design mode in InfoPath.
- On the Tools menu, click Form Options.
The Form Options dialog box appears. - Click the Advanced tab.
- Select your preferred language in the Form script language drop-down list, and then click OK.
- On the Tools menu, point to Script, and then click Microsoft Script Editor.
Microsoft Script Editor appears.
Remove the Script from Your Form Template
Important The following steps remove any existing script from your form template. To successfully change your scripting language after you have started Script Editor for your form template, you must complete all the following steps.
- Make a backup copy for your InfoPath form template (.xsn file).
- Open your template in Design mode in InfoPath.
- On the File menu, click Extract Form Files.
The Browse for Folder dialog box appears. - Select the folder that you want to extract the form files to, and then click OK.
- Close your form template.
- To modify Manifest.xsf, follow these steps:
- Start a text editor such as Notepad, or start an XML editor such as Visual Studio .NET. Open Manifest.xsf that is located in the folder where you extracted your form files.
- Locate and then delete the following section:
<xsf:file name="script.js">
<xsf:fileProperties>
<xsf:property name="scriptType" type="string" value="userEvents"></xsf:property>
</xsf:fileProperties>
</xsf:file> - Locate the xsf:solutionProperties node, and then delete the scriptLanguage attribute.
For example, if your InfoPath form currently uses JScript for the script language, the xsf:solutionProperties node will read as follows:<xsf:solutionProperties scriptLanguage="jscript" fullyEditableNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-09-10T17:55:25" lastOpenView="view1.xsl"></xsf:solutionProperties>
After you delete the scriptLanguage attribute, thexsf:solutionProperties node will read as follows::<xsf:solutionProperties fullyEditableNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-09-10T17:55:25" lastOpenView="view1.xsl"></xsf:solutionProperties>
- Locate and then delete the following section:
<xsf:scripts language="jscript">
<xsf:script src="script.js"></xsf:script>
</xsf:scripts>
- Save your changes to Manifest.xsf, and then close Script Editor.
- In Microsoft Windows Explorer, right-click Manifest.xsf, and then click Design.
Your template opens in Design mode in InfoPath. - On the File menu, click Save.
- To set your preferred script language, follow the steps in the "Change the Script Language for Your Form Template" section.
For additional information about debugging the script in your InfoPath form template, click the following article number to view the article in the Microsoft Knowledge Base:
827002Â
(http://kbalertz.com/Feedback.aspx?kbNumber=827002/
)
HOW TO: Debug a Script for a Microsoft Office InfoPath 2003 Form
APPLIES TO
- Microsoft Office InfoPath 2003
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate