Return to Snippet

Revision: 5761
at April 2, 2008 09:46 by wfdev


Updated Code
//
// Search form control function
//

$(document).ready(function(){
	
	// Get default search box value from hidden label
	$("#keywords").attr("value", $("#search label").text());
	
	// Clear search box only if default value present
	$("#keywords").focus(function(){
		if ($(this).attr("value") == $("#search label").text()) {
			$(this).attr("value", "");
		}
	});
	
});

Revision: 5760
at April 2, 2008 07:14 by wfdev


Initial Code
//
// Search form control function
//

$(document).ready(function(){
	
	// Get default search box value from hidden label
	$("#keywords").attr("value", $("#search label").text());
	
	// Clear search box only if default value present
	$("#keywords").focus(function(){
		if ($(this).attr("value") == $("#search label").text()) {
			$(this).attr("value", "");
		}
	});
	
});

Initial URL

                                

Initial Description

                                

Initial Title
Search field content control

Initial Tags
form, javascript, textmate, search

Initial Language
JavaScript