Using following code you can create a client side validation
<script>
// our validation script
function doValidate( f )
{
if(document.adminForm.task.value == 'gallarycat.cat_cancel')
{
return true;
}
if(
document.formvalidator.isValid( f ) )
{
alert('submit');
return true;
}
var form =
document.adminForm;
var validator = new
myFormValidator();
if( validator.isValid( form )
)
{
alert("submit");
submitform( pressbutton );
}
else
{
alert( 'Please correct any
errors before submission.' );
}
}
</script>