W3C home > Mailing lists > Public > www-html@w3.org > July 2000

changing ENCTYPE

From: <rick.myers@verizon.com>
Date: Wed, 19 Jul 2000 16:03:08 -0400 (EDT)
Message-ID: <vines.S0l8+1JURtA@txirvhqw064.irngtx.tel.gte.com>
To: <www-html@w3.org>

Is the <form> tag property ENCTYPE a modifiable variable (via scripts)?


A form with a default  'ENCTYPE="multipart/form-data"' will go to one CGI if 
a file is specified to upload, or it will go to another CGI if no file is 
specified.  The problem is that the first CGI accepts multipart data, whereas 
the second cgi accepts only 'application/x-www-urlencoded' data.  Therefore 
we were trying to swap the ENCTYPE of the form using JavaScript, however, 
nothing we did changed it.  It appeared that it takes only  what is specified 
in the form tag, and disregards any attempt to change that value 
dynamically.  Is this the normal function of the <form> tag?  Is ENCTYPE  a 
non-modifiable variable field (in which case I should refer to it as a 

I don't think this is a JavaScript question.  I know you can change the 
action and target of a form, and that ENCTYPE wasn't specifically mentioned 
as a property you can change (at least not in the book I was using for 

The only other thing I can think of is that the JS syntax is incorrect.  
Below is what we were using:


Any insight on the behaviour of ENCTYPE would be appreciated.


Received on Thursday, 20 July 2000 11:26:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:54 UTC