[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9126] more on registration
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9126] more on registration |
Date: |
Thu, 12 Apr 2012 09:15:27 +0000 |
Revision: 9126
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9126
Author: sigurdne
Date: 2012-04-12 09:15:26 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
more on registration
Added Paths:
-----------
trunk/registration/js/portico/
trunk/registration/js/portico/ajax.js
Added: trunk/registration/js/portico/ajax.js
===================================================================
--- trunk/registration/js/portico/ajax.js (rev 0)
+++ trunk/registration/js/portico/ajax.js 2012-04-12 09:15:26 UTC (rev
9126)
@@ -0,0 +1,135 @@
+$(document).ready(function(){
+
+ $("#loc1").change(function () {
+ var loc1 = $(this).val();
+ var oArgs = {menuaction:'registration.boreg.get_locations',
location_code:loc1};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ var htmlString = "";
+
+ $.ajax({
+ type: 'POST',
+ dataType: 'json',
+ url: requestUrl,
+ success: function(data) {
+ if( data != null)
+ {
+ htmlString = "<option>" + data.length
+ " lokasjone(r) funnet</option>"
+ var obj = data;
+
+ $.each(obj, function(i) {
+ htmlString += "<option
value='" + obj[i].id + "'>" + obj[i].name + "</option>";
+ });
+
+ $("#loc2").html( htmlString );
+ }
+ else
+ {
+ htmlString += "<option>Ingen
lokasjoner</option>"
+ $("#loc2").html( htmlString );
+ }
+ }
+ });
+ });
+
+ $("#loc2").change(function () {
+ var loc1 = $("#loc1").val();
+ var loc2 = $(this).val();
+ var oArgs = {menuaction:'registration.boreg.get_locations',
location_code:loc1 + "-" + loc2};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ var htmlString = "";
+
+ $.ajax({
+ type: 'POST',
+ dataType: 'json',
+ url: requestUrl,
+ success: function(data) {
+ if( data != null)
+ {
+ htmlString = "<option>" + data.length
+ " lokasjone(r) funnet</option>"
+ var obj = data;
+ $.each(obj, function(i) {
+ htmlString += "<option
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
+ });
+
+ $("#loc3").html( htmlString );
+ }
+ else
+ {
+ htmlString += "<option>Ingen
lokasjoner</option>"
+ $("#loc3").html( htmlString );
+ }
+ }
+ });
+ });
+
+ $("#loc3").change(function () {
+ var loc1 = $("#loc1").val();
+ var loc2 = $("#loc2").val();
+ var loc3 = $(this).val();
+ var oArgs = {menuaction:'registration.boreg.get_locations',
location_code:loc1 + "-" + loc2 + "-" + loc3};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ var htmlString = "";
+
+ $.ajax({
+ type: 'POST',
+ dataType: 'json',
+ url: requestUrl,
+ success: function(data) {
+ if( data != null)
+ {
+ htmlString = "<option>" + data.length
+ " lokasjone(r) funnet</option>"
+ var obj = data;
+ $.each(obj, function(i) {
+ htmlString += "<option
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
+ });
+
+ $("#loc4").html( htmlString );
+ }
+ else
+ {
+ htmlString += "<option>Ingen
lokasjoner</option>"
+ $("#loc4").html( htmlString );
+ }
+ }
+ });
+ });
+
+ $("#loc4").change(function () {
+ var loc1 = $("#loc1").val();
+ var loc2 = $("#loc2").val();
+ var loc3 = $("#loc3").val();
+ var loc4 = $(this).val();
+ var oArgs = {menuaction:'registration.boreg.get_locations',
location_code:loc1 + "-" + loc2 + "-" + loc3 + "-" + loc4};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ var htmlString = "";
+
+ $.ajax({
+ type: 'POST',
+ dataType: 'json',
+ url: requestUrl,
+ success: function(data) {
+ if( data != null)
+ {
+ htmlString = "<option>" + data.length
+ " lokasjone(r) funnet</option>"
+ var obj = data;
+ $.each(obj, function(i) {
+ htmlString += "<option
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
+ });
+
+ $("#loc5").html( htmlString );
+ }
+ else
+ {
+ htmlString += "<option>Ingen
lokasjoner</option>"
+ $("#loc5").html( htmlString );
+ }
+ }
+ });
+ });
+
+});
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9126] more on registration,
Sigurd Nes <=