15 lines
428 B
JavaScript
15 lines
428 B
JavaScript
function validateForm( form, newStorage ) {
|
|
var errors = new Array();
|
|
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 );
|
|
}
|