Improved the adminForm validation JavaScript, thanks @ro-ot
This commit is contained in:
@ -5,19 +5,9 @@ Joomla.submitbutton = function(task)
|
||||
if (task == ''){
|
||||
return false;
|
||||
} else {
|
||||
var isValid=true;
|
||||
var action = task.split('.');
|
||||
if (action[1] != 'cancel' && action[1] != 'close'){
|
||||
var forms = $$('form.form-validate');
|
||||
for (var i=0;i<forms.length;i++){
|
||||
if (!document.formvalidator.isValid(forms[i])){
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isValid){
|
||||
Joomla.submitform(task);
|
||||
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
return true;
|
||||
} else {
|
||||
alert(Joomla.JText._('###view###, some values are not acceptable.','Some values are unacceptable'));
|
||||
|
@ -5,19 +5,9 @@ Joomla.submitbutton = function(task)
|
||||
if (task == ''){
|
||||
return false;
|
||||
} else {
|
||||
var isValid=true;
|
||||
var action = task.split('.');
|
||||
if (action[1] != 'cancel' && action[1] != 'close'){
|
||||
var forms = $$('form.form-validate');
|
||||
for (var i=0;i<forms.length;i++){
|
||||
if (!document.formvalidator.isValid(forms[i])){
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isValid){
|
||||
Joomla.submitform(task);
|
||||
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
return true;
|
||||
} else {
|
||||
alert(Joomla.JText._('###sview###, some values are not acceptable.','Some values are unacceptable'));
|
||||
|
Reference in New Issue
Block a user