web/wp-content/themes/IRI-Theme/js/functions.js
author hurons@caf4f556-3d62-0410-8435-a86758001935
Thu, 24 Dec 2009 17:17:09 +0000
branchwordpress
changeset 110 1e6e4baafa3d
parent 109 03b0d1493584
permissions -rw-r--r--
little cleaning and aesthetics modifications

/************************************************************
 ** Clears a field
 ** By: 	Joshua Sowin (fireandknowledge.org)
 ** HTML: <input type="text" value="Search" name="search"
 **			id="search" size="25" 
 ** 		onFocus="clearInput('search', 'Search')" 
 ** 		onBlur="clearInput('search', 'Search')" />
 ***********************************************************/
function clearInput(field_id, term_to_clear) {
	
	// Clear input if it matches default value
	if (document.getElementById(field_id).value == term_to_clear ) {
		document.getElementById(field_id).value = '';
	}
	
	// If the value is blank, then put back term
	else if (document.getElementById(field_id).value == '' ) {
		document.getElementById(field_id).value = term_to_clear;
	}
} // end clearSearch()