From 36b1c4de92b3472adc270be9ccec4a4c9d826628 Mon Sep 17 00:00:00 2001 From: adv Date: Mon, 11 Apr 2011 08:57:49 +0000 Subject: version1.0 ticket:311 #311 validando formulario aulas git-svn-id: https://opengnsys.es/svn/branches/version1.0@1778 a21b9725-9963-47de-94b9-378ad31fedc9 --- admin/WebConsole/jscripts/propiedades_aulas.js | 11 +++++++++-- admin/WebConsole/jscripts/validators.js | 11 +++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'admin/WebConsole/jscripts') diff --git a/admin/WebConsole/jscripts/propiedades_aulas.js b/admin/WebConsole/jscripts/propiedades_aulas.js index 86b13256..61126a6f 100644 --- a/admin/WebConsole/jscripts/propiedades_aulas.js +++ b/admin/WebConsole/jscripts/propiedades_aulas.js @@ -102,8 +102,15 @@ function comprobar_datos(){ var form = document.fdatos; return validate (form.nombreaula, validate_notnull, 0) && - validate (form.puestos, validate_notnull, 1) && - validate (form.velmul, validate_number, 4); + validate (form.puestos, validate_number_notnull, 1) && + validate (form.router, validate_ipadress_notnull, 4) && + validate (form.netmask, validate_ipadress_notnull, 5) && + validate (form.modp2p, validate_notnull, 6) && + validate (form.timep2p, validate_number_notnull, 7) && + validate (form.modomul, validate_notnull, 8) && + validate (form.ipmul, validate_ipadress_notnull, 9) && + validate (form.pormul, validate_notnull, 10) && + validate (form.velmul, validate_number_notnull, 11); return(true); } diff --git a/admin/WebConsole/jscripts/validators.js b/admin/WebConsole/jscripts/validators.js index f99f9ff7..4fc91c75 100644 --- a/admin/WebConsole/jscripts/validators.js +++ b/admin/WebConsole/jscripts/validators.js @@ -42,6 +42,17 @@ function validate_alphanum_notnull(value) { return validate_number(value) && validate_notnull(value); } + +function validate_ipadress(value) { + return validate_expr(value, "^\\d+\\.\\d+\.\\d+\\.\\d+$"); +} + +function validate_ipadress_notnull(value) { + return validate_ipadress(value) && validate_notnull(value); +} + + + function validation_highlight(field) { field.focus(); field.style.border = "1px solid red"; -- cgit v1.2.3-18-g5258