Is it possible, in any way, to put data filled in a form and then submitted, in a *.js file?
Probably. You can write a file on the server, I don't know of any restrictions on the file extension. What are you trying to do?
http://www.phpbuilder.com/manual/function.fopen.php