<?xml version="1.0" encoding="[CONTENT_ENCODING/]"?>
Get rid of that. It has no place on the open web. You are not running this on an intranet where you are using real XHTML and users are not using Internet Explorer.
Besides that, even if you were, it's still optional unless you are using a charset other than UTF-8 or -16.
Second, what I see wrong in your code:
document.Form1.action = "formData.php"
I believe that, if you are going to use the form name (btw, "name" has been deprecated for forms when using XHTML, which is another reason why I don't believe you are using XHTML but just an XHTML doctype), you would have to do this:
Since you have to pick "Form1" out of the document.forms node list.
I see you are using an id on the form. I'd use that whichever method you choose:
You could also call it by its id with
Or at least, because I don't use name attributes on my forms (because once long ago the validator complained at me), I use id's and these work the same as the name.
So I'm assuming that "document.Form1.action" is not referring to anything, and this could explain why the action isn't getting changed.
So if you make the change above, you can check if your form action really did change to "FormData.php".
Does that help?