This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 15357
    
    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: 15357
    
    6
Try this:

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