[guadec-web] Enable/disable roommate depending on room type



commit b02f89780018d65bb3b27e1048a94f2c83751e3e
Author: Pascal Terjan <pterjan gmail com>
Date:   Tue Jul 15 20:50:40 2014 +0000

    Enable/disable roommate depending on room type

 guadec/js/calculate-total.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/guadec/js/calculate-total.js b/guadec/js/calculate-total.js
index 9260399..cbc708f 100644
--- a/guadec/js/calculate-total.js
+++ b/guadec/js/calculate-total.js
@@ -100,6 +100,16 @@ function enableDisableL(obj) {
                
        }
 }
+
+function enableDisableR(obj) {
+       if ($(obj).val() == "double") {
+               $("[name=roommate]").prop("disabled", false);
+       }
+       else {
+               $("[name=roommate]").prop("disabled", true);
+       }
+}
+
 $(function() {
 
 
@@ -113,6 +123,7 @@ $(function() {
        })
        $('[name=room_type]').on('change' , function(){
                callAccomCalculate();
+               enableDisableR(this);   
        })
 
         /* Checkboxes call events */


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