When migrating InfoPath 2003 or 2007 forms from previous versions, the original developer could have included some JScript code in the form. This code responds to various events such as the form loading, clicking on buttons, changes to the form, etc. If you try to load this form in the “latest” (InfoPath stopped being latest in 2013 when Microsoft stopped development on it), you will see this message if you look at the code:
Any JScript that was embedded into the form won’t run and isn’t compatible with InfoPath 2013 – Microsoft dropped support for JScript in 2010. You cannot even open the code to view it – the only option you have is to remove it.
If you want to keep this code, you’ll have to port it to C# by opening the form in a previous version of InfoPath (e.g. 2003 or 2007), scraping out the original JScript code and re-writing it as C# code.