Changeset 64 for Dev/trunk/classes/SurveyCreationTool.php
- Timestamp:
- 08/02/11 11:58:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/SurveyCreationTool.php
r61 r64 34 34 private static function javascript($id = null) { 35 35 ?> 36 <script type="text/javascript" src="js/creation.js"></script> 36 37 <script type="text/javascript"> 37 38 /* autosave every 3 minutes */ … … 75 76 return questionDiv; 76 77 } 77 78 function handleFocus(input)79 {80 /* this is such ugly code it makes me sad */81 /* because it is hard coded. */82 if (input.clicked == null &&83 (input.value == "Untitled Survey"84 || input.value == "Write a helpful description for this survey here."85 || input.value == "Write a question description here."86 || input.value == "Untitled Question"))87 {88 input.value = "";89 input.style.color = "black";90 input.clicked = true;91 }92 }93 94 function handleBlur(input)95 {96 var surveyTitle = document.getElementById('surveyTitle');97 var surveyDescription = document.getElementById('surveyDescription');98 99 if (input.value == "")100 {101 input.style.color = "gray";102 input.clicked = null;103 104 if (input == surveyTitle)105 {106 input.value = "Untitled Survey";107 }108 else if (input == surveyDescription)109 {110 input.value = "Write a helpful description for this survey here.";111 }112 }113 }114 78 115 79 function handleType(select, answers) … … 397 361 $value = 'Untitled Survey'; 398 362 ?> 399 <input type="text" id="surveyTitle" name="surveyTitle" value="<?php echo $value?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" />363 <input type="text" id="surveyTitle" class="titleBox" name="surveyTitle" value="<?php echo $value; ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" /> 400 364 <?php 401 365 } … … 419 383 $value = 'Write a helpful description for this survey here.'; 420 384 ?> 421 <textarea id="surveyDescription" name="surveyDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea>385 <textarea id="surveyDescription" class="descriptionBox" name="surveyDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea> 422 386 <?php 423 387 }
Note: See TracChangeset
for help on using the changeset viewer.