You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Anuradha S.Athreya" <an...@world2web.com> on 2005/08/26 08:23:42 UTC

File Upload enctype

Hello,

I have 2 different issues, which are listed below 
(1)	To upload a file , is it necessary to specify the
enctype="multipart/form-data". Can Struts handle file upload in another way
when the enctype has not been specified.
(2)
	<script>
function validateDelete()
{
	return confirm("Delete Data");	
}
</script>	


	<html:link action="deleteData" name="deleteDataParams" scope="page"
onclick="return validateDelete()" >
      				Delete Data 
      			</html:link>

	To the validateDelete() Javascript function, I want to pass a java
variable. How do I do it? 
	Once I pass the variable, my javascript function has to be :

		<script>
function validateDelete(data)
{
	return confirm("Delete Data"+data);	
}
</script>	

Re: File Upload enctype

Posted by David Delbecq <de...@oma.be>.
Le Vendredi 26 Août 2005 08:23, Anuradha S.Athreya a écrit :
> Hello,
> 
> I have 2 different issues, which are listed below 
> (1)	To upload a file , is it necessary to specify the
> enctype="multipart/form-data". Can Struts handle file upload in another way
> when the enctype has not been specified.

not that i know about (struts uses jakarta http fileupload library, supporting only multipart/form-date for files)
and am not sure another method has been defined by w3c.

> (2)
> 	<script>
> function validateDelete()
> {
> 	return confirm("Delete Data");	
> }
> </script>	
> 
> 
> 	<html:link action="deleteData" name="deleteDataParams" scope="page"
> onclick="return validateDelete()" >
>       				Delete Data 
>       			</html:link>
> 
> 	To the validateDelete() Javascript function, I want to pass a java
> variable. How do I do it? 
> 	Once I pass the variable, my javascript function has to be :
> 
> 		<script>
> function validateDelete(data)
> {
> 	return confirm("Delete Data"+data);	
> }
> </script>	
> 

Have you tried this?
 	<html:link action="deleteData" name="deleteDataParams" scope="page" 
onclick="return validateDelete('${someBean.someValue}')" >
       				Delete Data 
	</html:link>
-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org