manusoftar

Untitled

Oct 27th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 4.05 KB | None | 0 0
  1. function processServAction(modo){
  2.                                 console.log("Modo: " + modo);
  3.                                  switch(modo){
  4.                                               case modes.UpServ:
  5.                                                         var jsonArr;
  6.                                                         $.getJSON('../php/query.php',{ T : 3, V : userData.Id }, function(response,status,xhr){
  7.                                                                         jsonArr = response;
  8.                                                         });
  9.                                                         //console.info(jsonArr);
  10.                                                         $('#contenedor').load("addService.htm", function(){
  11.                                                             $.each(jsonArr, function(i,row){
  12.                                                                 $('#domains').append("<option id='" + row.idDominio + "'>" + row.url + "</option>" );
  13.                                                             });
  14.                                                            
  15.                                                             //Limit port field to only numbers
  16.                                                              $('#port').on("keypress", function(e){
  17.                                                                 if ("01234567890.-\b\0".indexOf(String.fromCharCode(e.which)) < 0) {
  18.                                                                         event.preventDefault();
  19.                                                                 }          
  20.                                                             });
  21.                                                            
  22.                                                             $('#sCancel').on("click",function(e){cancelAction(e);});
  23.                                                             $('#sAlta').on("click", function(e){ altaServicio(e);});
  24.                                                                                                                                                                    
  25.                                                                                                                                                                    
  26.                                                            function altaServicio(e){
  27.                                                                             e.preventDeafult();
  28.                                                                            
  29.                                                                             var jsonObj = { "Frec" : $('#frec').val(),
  30.                                                                                                          "sendMail" : getCheckVal($('#sendMail')),
  31.                                                                                                          "VerifConf" : getCheckVal($('#verifConf')),
  32.                                                                                                          "VerifProcess" : getCheckVal($('#verifProc')) };
  33.                                                                            
  34.                                                                             $.getJSON('../php/getConfId.pgp', { config : jsonObj }, function(reponse){
  35.                                                                                                 console.info(response);
  36.                                                                             });
  37.                                                            }              
  38.                                                         });
  39.                                                        
  40.                                                         function getCheckVal(chk){
  41.                                                             chk.is(":checked") ? 1 : 0;
  42.                                                         }
  43.                                               break;
  44.                                  }
  45.                }
Advertisement
Add Comment
Please, Sign In to add comment