1 function verify_selecteerbaar (a) {
2 var f = document.forms[0]; var a;
3 if (f.box5.value != 0) a = f.box5.value;
4 else if (f.box4.value != 0) a = f.box4.value;
5 else if (f.box3.value != 0) a = f.box3.value;
6 else if (f.box2.value != 0) a = f.box2.value;
7 else if (f.box1.value != 0) a = f.box1.value;
8 else { alert('You must choose an activity.'); return false; }
16 if ( answer == 'false') { alert("Please select again"); return false; }
21 ==================================================
22 DROPDOWNS FOR ACTIVITIES
24 ==================================================
28 $(document).ready(function(){
29 var link_dbc = '../../../library/DBC_functions.php';
34 $('#box1').bind('change', function(){
39 data: 'code=' + $('#box1').val(),
43 // validation for timing NOTA maybe not used anymore
44 /*valbox = $('#box1').val();
45 if ( valbox == 'act_1' || valbox == 'act_7' ) {
46 this.form.form_duration.disabled = true; this.form.form_duration.value = 0;
47 this.form.form_duration_indirect.disabled = true;
48 this.form.form_duration_travel.disabled = true;
50 this.form.form_duration.disabled = false;
51 this.form.form_duration_indirect.disabled = false;
52 this.form.form_duration_travel.disabled = false;
56 $('#box1').bind('focus', function(){
57 $('#box2').show(); $('#box3').hide(); $('#box4').hide(); $('#box5').hide();
60 $('#box2').bind('change', function(){
65 data: 'code=' + $('#box2').val(),
70 // if empty box, prevent the next to show
71 $('#box2').bind('focus', function(){
72 if ( $('#box2').val() != 0 ) {
77 $('#box4').hide(); $('#box5').hide();
80 $('#box3').bind('change', function(){
85 data: 'code=' + $('#box3').val(),
90 // if empty box, prevent the next to show
91 $('#box3').bind('focus', function(){
92 if ( $('#box3').val() != 0 ) {
100 $('#box4').bind('change', function(){
105 data: 'code=' + $('#box4').val(),
110 // if empty box, prevent the next to show
111 $('#box4').bind('focus', function(){
112 if ( $('#box4').val() != 0 ) {
119 // time validation client side
120 $('#form_save').bind('click', function(){
121 // validation for timing
122 durbox = $('#form_duration').val();
123 valbox = $('#box2').val();
124 if ( valbox == 'act_3.2' && (!parseInt(durbox, 10)) ) {
125 alert("For selected activity you must have a value for direct time!");
135 ==================================================
138 ==================================================
140 function editcase() {
141 $(document).ready(function(){
142 var link_dbc = '../../../library/DBC_functions.php';
143 $('#box1').attr('disabled', true);
144 $('#addc').bind('click', function(){
145 $('#box1').attr('disabled', false);