vineet
12-31-2008, 03:41 PM
hi all
i have two functions
function Checkfiles(f){
f = f.elements;
if(/.*\.(gif)|(jpeg)|(jpg)$/.test(f['banner_image'].value.toLowerCase()))
return true;
alert('Please Upload Gif or Jpg Images.');
f['banner_image'].focus();
return false;
};
function start()
{
document.getElementById('worli').style.visibility = 'visible';
}
calling these functions
<form action="" method="post" enctype="multipart/form-data" name="form_up" id="form_up" onsubmit="start(); return Checkfiles(this);">
what i need is, if "function checkfiles" returns no error or no alert then "function start" should work otherwise not.
vineet
i have two functions
function Checkfiles(f){
f = f.elements;
if(/.*\.(gif)|(jpeg)|(jpg)$/.test(f['banner_image'].value.toLowerCase()))
return true;
alert('Please Upload Gif or Jpg Images.');
f['banner_image'].focus();
return false;
};
function start()
{
document.getElementById('worli').style.visibility = 'visible';
}
calling these functions
<form action="" method="post" enctype="multipart/form-data" name="form_up" id="form_up" onsubmit="start(); return Checkfiles(this);">
what i need is, if "function checkfiles" returns no error or no alert then "function start" should work otherwise not.
vineet