diff options
author | irina <irinagomez@us.es> | 2017-05-24 10:52:20 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2017-05-24 10:52:20 +0000 |
commit | 2907fc5a9171829dd9a1b71dbaef5f4bbf1be9d1 (patch) | |
tree | b2a4f331badf742ca2476f382127c468d2a64821 /admin/WebConsole/jscripts | |
parent | 35a63b6d5d634b601225410c1454804fef9e2be0 (diff) |
#730 Consola propiedades ordenador: Se valida el nombre para que sólo contenga caracteres alfanuméricos, subrayados y guiones.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5315 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/jscripts')
-rw-r--r-- | admin/WebConsole/jscripts/propiedades_ordenadores.js | 3 | ||||
-rw-r--r-- | admin/WebConsole/jscripts/validators.js | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/admin/WebConsole/jscripts/propiedades_ordenadores.js b/admin/WebConsole/jscripts/propiedades_ordenadores.js index 44634e49..f42c309f 100644 --- a/admin/WebConsole/jscripts/propiedades_ordenadores.js +++ b/admin/WebConsole/jscripts/propiedades_ordenadores.js @@ -92,7 +92,8 @@ function comprobar_datos(){ return(false); } - return validate (form.nombreordenador, validate_notnull, 0) && + return validate (form.nombreordenador, validate_notspace, 0) && + validate (form.nombreordenador, validate_text_notnull, 0) && validate (form.ip, validate_ipadress_notnull, 1) && validate (form.mac, validate_macaddress_notnull, 2) && validate (form.numserie, validate_alphanum, 3) && diff --git a/admin/WebConsole/jscripts/validators.js b/admin/WebConsole/jscripts/validators.js index 7c031f8b..5dacf1cb 100644 --- a/admin/WebConsole/jscripts/validators.js +++ b/admin/WebConsole/jscripts/validators.js @@ -94,6 +94,9 @@ function validate_text(value) { function validate_text_notnull(value) { return validate_text(value) && validate_notnull(value); } +function validate_notspace(value) { + return ! validate_expr(value, /.*[ ]/); +} function validation_highlight(field) { field.focus(); |