fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14115] added document validation


From: Saul
Subject: [Fmsystem-commits] [14115] added document validation
Date: Mon, 05 Oct 2015 23:57:38 +0000

Revision: 14115
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14115
Author:   psaul
Date:     2015-10-05 23:57:37 +0000 (Mon, 05 Oct 2015)
Log Message:
-----------
added document validation

Modified Paths:
--------------
    branches/dev-syncromind/booking/js/booking/application.js

Modified: branches/dev-syncromind/booking/js/booking/application.js
===================================================================
--- branches/dev-syncromind/booking/js/booking/application.js   2015-10-05 
23:55:42 UTC (rev 14114)
+++ branches/dev-syncromind/booking/js/booking/application.js   2015-10-05 
23:57:37 UTC (rev 14115)
@@ -33,9 +33,28 @@
         var selection = [];
         populateTableChkRegulations(building_id_selection, selection, 
resources);
     });
+    
+    $('#application_form').submit(function(e){
+        if(!validate_documents()){
+            e.preventDefault();
+            alert(lang['You must accept to follow all terms and conditions of 
lease first.']);
+        }
+    });
+    
 });
 
+function validate_documents() {
+    var n = 0;
+    $('#regulation_documents 
input[name="accepted_documents[]"]').each(function(){
+         if(!$(this).is(':checked')) {
+             n++;
+         }
+    });
+    var v = (n == 0) ? true : false;
+    return v;
+}
 
+
 function populateTableChkResources (building_id, selection) {
     var url = 
'index.php?menuaction=bookingfrontend.uiresource.index_json&sort=name&filter_building_id='
 +  building_id + '&phpgw_return_as=json&';
     var container = 'resources_container';




reply via email to

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