Your comments

Never mind, nothing is wrong with the editor - this happens in all browsers. I think any unescaped </script>s close off the end of the script early

Sorry, I wasn't specific enough - when the file is in the Textastic preview, the code in the picture will display this and cut off the rest of the js:

The problem seems to be that the </script> inside the string in the inline js is interpreted, and then closes off the script tag early.

There is no problem with this in Safari.

I no longer have this problem in iOS 9, but for those in iOS 8.4 and under, here is the HTML:

<form method="post" action="whatever.php">
<input type="file" name="" value="" />
Although the form was more complex than this html, the same problem occurred with a basic form
Sorry I took 2 months to reply