Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

input type=file

 
ALaxmi Shankaran
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code?
 
ALaxmi Shankaran
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic