This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 15385
    
    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: 15385
    
    6
Try this:

 
Have you checked out Aspose?
 
subject: input type=file
 
It's not a secret anymore!