Changeset 54
- Timestamp:
- 07/26/11 15:33:20 (14 years ago)
- Location:
- Dev/trunk/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/SurveyCreationTool.php
r53 r54 374 374 } 375 375 } 376 377 376 378 377 </script> 379 378 <?php -
Dev/trunk/classes/SurveyTool.php
r52 r54 13 13 $this->survey = $survey; 14 14 15 $this->javascript(); 15 16 $this->init(); 17 } 18 19 private function javascript() { 20 ?> 21 <script type="text/javascript"> 22 /* --- input checking --- */ 23 function checksPassed(form) 24 { 25 for (var i = 0; i < form.length; i++) 26 { 27 if (form.elements[i].checkPassed == 'no') 28 return false; 29 } 30 return true; 31 } 32 33 function checkInt(input) 34 { 35 input.style.borderWidth = '1px' ; 36 var value = input.value; 37 if (isNaN(value)) 38 { 39 input.style.borderColor = 'red'; 40 input.checkPassed = 'no'; 41 } 42 else 43 { 44 input.style.border = '1px solid #abadb3'; 45 input.checkPassed = null; 46 } 47 } 48 </script> 49 <?php 16 50 } 17 51 18 52 private function init() { 19 53 ?> 20 <form action="" method="post">54 <form name="survey" action="" onsubmit="return checksPassed(this)" method="post"> 21 55 <?php 22 56 $this->displayTitle(); … … 78 112 case 'int': 79 113 ?> 80 <input type="text" name="<?php echo 'q' . $numQ . 'ans1' ?>" value="" class="intBox"/>114 <input type="text" name="<?php echo 'q' . $numQ . 'ans1' ?>" value="" onchange="checkInt(this)" class="intBox"/> 81 115 <?php 82 116 break; … … 101 135 <?php 102 136 for ($i = 1; $i < $question->answers[3] + 1; $i++) { 103 ?><input type="radio" class="scaleRadio" name="<?php echo 'q' . $numQ . 'ans1' ?>" value="<?php echo $i; ?>"/><?php } ?>137 ?><input type="radio" class="scaleRadio" name="<?php echo 'q' . $numQ . 'ans1' ?>" value="<?php echo $i; ?>"/><?php } ?> 104 138 <div class="scaleLabel"><?php echo $question->answers[2]; ?></div> 105 139 <?php
Note: See TracChangeset
for help on using the changeset viewer.