diff options
author | adv <adv@uma.es> | 2011-05-22 17:15:37 +0000 |
---|---|---|
committer | adv <adv@uma.es> | 2011-05-22 17:15:37 +0000 |
commit | 3b3043b9fca284da6d03053d6bfa71d2cbdfecb0 (patch) | |
tree | f79e7f22309c8750a0a80105b7eb88166f38fbd2 /admin/WebConsole/jscripts | |
parent | 4e51cb0a88e140762e0152bbb9adb18cb887f359 (diff) |
version 1.0.1 #270 #390 validado formulario alta/modificacion objeto imagen
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2008 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/jscripts')
-rw-r--r-- | admin/WebConsole/jscripts/propiedades_imagenes.js | 34 | ||||
-rw-r--r-- | admin/WebConsole/jscripts/validators.js | 3 |
2 files changed, 20 insertions, 17 deletions
diff --git a/admin/WebConsole/jscripts/propiedades_imagenes.js b/admin/WebConsole/jscripts/propiedades_imagenes.js index dc1ac94e..2cecc566 100644 --- a/admin/WebConsole/jscripts/propiedades_imagenes.js +++ b/admin/WebConsole/jscripts/propiedades_imagenes.js @@ -74,23 +74,23 @@ function confirmar(op){ // Comprobar_datos //________________________________________________________________________________________________________ function comprobar_datos(){ - if (document.fdatos.nombreca.value=="") { - alert(TbMsg[3]); - document.fdatos.nombreca.focus(); - return(false); + function validate (field, validator, msgi) { + if (!validator (field.value)) { + alert(TbMsg[msgi]); + validation_highlight (field); + return false; + } + return true; } - if (document.fdatos.descripcion.value=="") { - alert(TbMsg[0]); - document.fdatos.descripcion.focus(); - return(false); - } - /* - var p=document.fdatos.idperfilsoft.selectedIndex - if (p==0){ - alert(TbMsg[1]) - document.forms.fdatos.idperfilsoft.focus() - return(false) - } - */ + + + var form = document.fdatos; + return validate (form.nombreca, validate_nameimagefile, 3) && + validate (form.nombreca, validate_notnull, 3) && + validate (form.descripcion, validate_notnull, 0) && + validate (form.numpar, validate_notnull, 4) && + validate (form.codpar, validate_notnull, 5) && + validate (form.idrepositorio, validate_notnull, 6); + return(true); } diff --git a/admin/WebConsole/jscripts/validators.js b/admin/WebConsole/jscripts/validators.js index 4fc91c75..e0359505 100644 --- a/admin/WebConsole/jscripts/validators.js +++ b/admin/WebConsole/jscripts/validators.js @@ -51,6 +51,9 @@ function validate_ipadress_notnull(value) { return validate_ipadress(value) && validate_notnull(value); } +function validate_nameimagefile(value) { + return validate_expr(value, "^[0-9a-zA-Z]*$"); +} function validation_highlight(field) { |