Help and Support
 

powered byLive Search

How To: Change the Script Language for Your InfoPath Form

Article ID:828853
Last Review:October 23, 2006
Revision:1.2
On This Page

SUMMARY

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.

Back to the top

MORE INFORMATION

Change the Script Language for Your Form Template

1.Open your template in Design mode in InfoPath.
2.On the Tools menu, click Form Options.

The Form Options dialog box appears.
3.Click the Advanced tab.
4.Select your preferred language in the Form script language drop-down list, and then click OK.
5.On the Tools menu, point to Script, and then click Microsoft Script Editor.

Microsoft Script Editor appears.

Back to the top

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.
1.Make a backup copy for your InfoPath form template (.xsn file).
2.Open your template in Design mode in InfoPath.
3.On the File menu, click Extract Form Files.

The Browse for Folder dialog box appears.
4.Select the folder that you want to extract the form files to, and then click OK.
5.Close your form template.
6.To modify Manifest.xsf, follow these steps:
a. 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.
b. 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>
c. 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>
d. Locate and then delete the following section:
<xsf:scripts language="jscript">
     <xsf:script src="script.js"></xsf:script>
</xsf:scripts>
e. Save your changes to Manifest.xsf, and then close Script Editor.
7. In Microsoft Windows Explorer, right-click Manifest.xsf, and then click Design.

Your template opens in Design mode in InfoPath.
8.On the File menu, click Save.
9. To set your preferred script language, follow the steps in the "Change the Script Language for Your Form Template" section.

Back to the top

REFERENCES

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://support.microsoft.com/kb/827002/) HOW TO: Debug a Script for a Microsoft Office InfoPath 2003 Form

Back to the top


APPLIES TO
Microsoft Office InfoPath 2003

Back to the top

Keywords: 
kbhowto KB828853

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.