Connecting Tech Pros Worldwide Help | Site Map

Forms Using EncType = Multipart - Text Is Not Passed !

  #1  
Old July 20th, 2005, 06:45 PM
Lovely Angel For You
Guest
 
Posts: n/a
Dear Friends
Hope you all are doing great.

I am using a form to add text data to the database. With this form I
am also using a file field to upload a image file.

To use the first thing that is just data I dont have to write EncType
as it picks the default one. But to use the second one that is to
upload an image. I need to write EncType = "multipart/form-data". When
I do this the text passed from the other text field goes blank.

Why is it happening.

Is it that I cant get text data when I use
EncType="multipart/form-data".

Please help in solving this problem.

Love
Lovely

_________________________________________________

<tr>
<td width="100%" valign="top">
<form method="POST" action="data_save.asp"
EncType="multipart/form-data">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0"
width="100%">
<tr>
<td width="100%" colspan="2">Add a new Main
Category</td>
</tr>
<tr>
<td width="20%">&nbsp;</td>
<td width="80%"></td>
</tr>
<tr>
<td width="20%">Name</td>
<td width="80%"><input type="text" name="name"
size="43"></td>
</tr>
<tr>
<td width="20%">Image</td>
<td width="80%"><input type="text"
name="image"></td>
</tr>
<tr>
<td width="20%">Description</td>
<td width="80%"><textarea rows="2"
name="description" cols="37"></textarea></td>
</tr>
</table>
</div>
<p align="center"><input type="submit" value="Submit"
name="B1"></p>
<input type="hidden" name="Category" value="0">
<input type="hidden" name="Choice" value="1">
</form>
</td>
</tr>
  #2  
Old July 20th, 2005, 06:45 PM
Jukka K. Korpela
Guest
 
Posts: n/a

re: Forms Using EncType = Multipart - Text Is Not Passed !


lovely_angel_for_you@yahoo.com (Lovely Angel For You) wrote:
[color=blue]
> Is it that I cant get text data when I use
> EncType="multipart/form-data".[/color]

Of course you can. Dealing with a text field is much easier than
processing the file field. But exactly how you do that depends on the
server-side technology used and is external to HTML.

HTML only defines how the data is sent - in this case, as a set of
documents inside a multipart message.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

  #3  
Old July 20th, 2005, 06:46 PM
Harlan Messinger
Guest
 
Posts: n/a

re: Forms Using EncType = Multipart - Text Is Not Passed !


lovely_angel_for_you@yahoo.com (Lovely Angel For You) wrote:
[color=blue]
>Dear Friends
>Hope you all are doing great.
>
>I am using a form to add text data to the database. With this form I
>am also using a file field to upload a image file.
>
>To use the first thing that is just data I dont have to write EncType
>as it picks the default one. But to use the second one that is to
>upload an image. I need to write EncType = "multipart/form-data". When
>I do this the text passed from the other text field goes blank.
>
>Why is it happening.
>[/color]

Because your server-side process (you didn't say what you're using)
conveniently sets Request.Form variables (or the equivalent) for you
if and only if you use the default enctype (as is the case in Active
Server Pages). Otherwise, you're on your own to parse them out of the
request.



--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ๔ter le premier point de mon adresse de courriel.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
why encodeURIComponent() for data in body of POST XHR request? Peter Michaux answers 10 August 2nd, 2007 08:05 PM