You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by cd...@apache.org on 2005/09/19 13:39:04 UTC

svn commit: r290117 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/common/scripts/getBlank.js

Author: cdupoirieux
Date: Mon Sep 19 04:38:51 2005
New Revision: 290117

URL: http://svn.apache.org/viewcvs?rev=290117&view=rev
Log:
Add of getPrompt function to redisplay the prompt when search field is empty.

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/common/scripts/getBlank.js

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/common/scripts/getBlank.js
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/common/scripts/getBlank.js?rev=290117&r1=290116&r2=290117&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/common/scripts/getBlank.js (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/common/scripts/getBlank.js Mon Sep 19 04:38:51 2005
@@ -15,17 +15,25 @@
 * limitations under the License.
 */
 /**
- * This script, when included in a html file and called from a form text field, will set the value of this field to ""
+ * getBlank script - when included in a html file and called from a form text field, will set the value of this field to ""
  * if the text value is still the standard value.
+ * getPrompt script - when included in a html file and called from a form text field, will set the value of this field to the prompt
+ * if the text value is empty.
  *
  * Typical usage:
  * <script type="text/javascript" language="JavaScript" src="getBlank.js"></script>
- * <input type="text" id="query" value="Search the site:" onFocus="getBlank (this, 'Search the site:');"/>
+ * <input type="text" id="query" value="Search the site:" onFocus="getBlank (this, 'Search the site:');" onBlur="getPrompt (this, 'Search the site:');"/>
  */
 <!--
 function getBlank (form, stdValue){
 if (form.value == stdValue){
 	form.value = '';
+	}
+return true;
+}
+function getPrompt (form, stdValue){
+if (form.value == ''){
+	form.value = stdValue;
 	}
 return true;
 }