some rustic debug/profiling tools builtin tables - users page does not autosort
[plewww.git] / planetlab / nodes / interface.js
index 1669779..e97487f 100644 (file)
@@ -80,6 +80,7 @@ function same_subnet (ip1,ip2,masklen) {
 }
 
 function networkHelper () {
+  window.console.log('networkHelper');
   var ip=$('ip').value;
   var nm=$('netmask').value;
 
@@ -104,7 +105,16 @@ function networkHelper () {
 }
 
 /* check one */
-function subnetChecker (args) {
+function subnetChecker (id, optional) {
+  var error= subnetCheckerSilent([id,optional]);
+  if (error) {
+    Form.Element.focus($(id));
+    alert(error);
+  }
+}
+
+function subnetCheckerSilent (args) {
+  
   id=args[0];
   optional=args[1];
 
@@ -124,13 +134,13 @@ function subnetChecker (args) {
   return "";
 }
 
-function formSubmit () {
+function interfaceSubmit () {
+  alert ('submitting');
   // get error strings, and remove the empty ones
   // dns2 is optional
-  var errors=['gateway','dns1'].zip ([true,true,false],subnetChecker).reject( function (s) {return s.length==0;} );
+  var errors=['gateway','dns1','dns2'].zip ([true,true,false],subnetCheckerSilent).reject( function (s) {return s.length==0;} );
   if ( ! errors.length)
     $('ip').up('form').submit();
   else
     alert(errors.join("\n"));
 }
-