File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes input type=file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "input type=file" Watch "input type=file" New topic
Author

input type=file

ALaxmi Shankaran
Greenhorn

Joined: Feb 23, 2004
Posts: 26
I am facing one problem one field in my jsp is of the input type - file
onblur of that i have written one js function and checking for some validation
and then returning true/false accordingly but in this case my page get submitted even though
the function returns false can anybody has solution?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
code?
ALaxmi Shankaran
Greenhorn

Joined: Feb 23, 2004
Posts: 26
function validate(){
if((document.all.filname.value=="") || (document.all.filname.value==null)){
alert("Please enter filename");
return false;
}
else{
//code to submit the form
return true;
}
}
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Try this:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: input type=file
 
Similar Threads
input type=image with JS
Reading parameter from JSP page
executing a javascript function from a servlet
how to disable if one or more check boxes selected
error in javascript when doing form.action