fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9402] property: alternative


From: Sigurd Nes
Subject: [Fmsystem-commits] [9402] property: alternative
Date: Tue, 15 May 2012 07:14:07 +0000

Revision: 9402
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9402
Author:   sigurdne
Date:     2012-05-15 07:14:06 +0000 (Tue, 15 May 2012)
Log Message:
-----------
property: alternative

Modified Paths:
--------------
    trunk/registration/js/portico/ajax.js

Modified: trunk/registration/js/portico/ajax.js
===================================================================
--- trunk/registration/js/portico/ajax.js       2012-05-15 06:05:33 UTC (rev 
9401)
+++ trunk/registration/js/portico/ajax.js       2012-05-15 07:14:06 UTC (rev 
9402)
@@ -202,6 +202,67 @@
                        } 
                });     
     });
+/*
 
+$(".choose_loc").live( "change", function () {
+               var thisSelectBox = $(this);
+               var loc_code = $(this).val();
+               var loc_id = $(this).attr("id");
+               var loc_arr = loc_id.split('_');
+               var loc_level = parseInt(loc_arr[1]);
+               var new_loc_id = "loc_" + (parseInt(loc_level)+1);
+               
+               var id = "";
+               var new_loc_code = "";
+               var level;
+               for(level = 1;level <= loc_level;level++){
+                       id = "loc_" + level;
+                       if(level > 1)
+                               new_loc_code += "-" + $("#" + id).val();
+                       else
+                               new_loc_code += $("#" + id).val();
+               }
+               
+               if(!loc_code)
+               {
+                       return false;
+               }
+               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:new_loc_code};
+               var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
+      
+               var htmlString = "";
+
+               $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       url: requestUrl,
+                       success: function(data) {
+                               if( data != null)
+                               {
+                                       htmlString  = "<select 
class='choose_loc' name='" + new_loc_id  + "' id='" + new_loc_id  + "' >" +
+                                                                 "<option 
value = ''>" + data.length + " lokasjone(r) funnet</option>";
+                                                                 
+                                                                 
+                                       var obj = data;
+
+                                       $.each(obj, function(i) {
+                                               htmlString  += "<option 
value='" + obj[i].id + "'>" + obj[i].name + "</option>";
+                                       });
+
+                                       htmlString += "</select>";
+                                       
+                                       $(thisSelectBox).after( htmlString );
+                               }
+                               else
+                               {
+                                       htmlString  += "<option>Ingen 
lokasjoner</option>"
+                                       $(new_loc_id).html( htmlString );
+                               }
+                       } 
+               });     
+    });
+
+*/
+
 });
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]