forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdupoiri...@apache.org
Subject svn commit: r290116 - /forrest/trunk/main/webapp/skins/common/scripts/getBlank.js
Date Mon, 19 Sep 2005 11:33:43 GMT
Author: cdupoirieux
Date: Mon Sep 19 04:29:59 2005
New Revision: 290116

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

Modified:
    forrest/trunk/main/webapp/skins/common/scripts/getBlank.js

Modified: forrest/trunk/main/webapp/skins/common/scripts/getBlank.js
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/scripts/getBlank.js?rev=290116&r1=290115&r2=290116&view=diff
==============================================================================
--- forrest/trunk/main/webapp/skins/common/scripts/getBlank.js (original)
+++ forrest/trunk/main/webapp/skins/common/scripts/getBlank.js Mon Sep 19 04:29:59 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="getBlank (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;
 }



Mime
View raw message