That code was accepted without errors in script editor but then when i tried to preview the page it came up with "InfoPath cannot create a new, blank form. The form template is not valid"
When clicking on the more info button it comes up with
"InfoPath cannot open the selected form because of an error in the form's ...