2019-01-19 23:32:40 +08:00
|
|
|
|
2019-01-19 22:41:53 +08:00
|
|
|
function validateForm(form) {
|
2019-01-20 01:40:17 +08:00
|
|
|
var errors = [];
|
|
|
|
if ( !form.elements['newStorage[Name]'].value ) {
|
|
|
|
errors[errors.length] = 'You must supply a name';
|
|
|
|
}
|
|
|
|
if ( !form.elements['newStorage[Path]'].value ) {
|
|
|
|
errors[errors.length] = 'You must supply a path';
|
|
|
|
}
|
|
|
|
if ( errors.length ) {
|
|
|
|
alert(errors.join("\n"));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2017-01-31 10:16:21 +08:00
|
|
|
}
|