summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/jscripts
diff options
context:
space:
mode:
authoradv <adv@uma.es>2011-04-11 08:57:49 +0000
committeradv <adv@uma.es>2011-04-11 08:57:49 +0000
commit36b1c4de92b3472adc270be9ccec4a4c9d826628 (patch)
treea50acfb0f1207852cb916dc1e54dace1cfb80536 /admin/WebConsole/jscripts
parentfb7908adcbd7267a58c2a722213c39b7aee1ef0f (diff)
version1.0 ticket:311 #311 validando formulario aulas
git-svn-id: https://opengnsys.es/svn/branches/version1.0@1778 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/jscripts')
-rw-r--r--admin/WebConsole/jscripts/propiedades_aulas.js11
-rw-r--r--admin/WebConsole/jscripts/validators.js11
2 files changed, 20 insertions, 2 deletions
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";