Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In Chapter 11, we showed how you could make enhancements to the site using some simple jQuery code. If you cast your mind back, I suggested placing the code in a common JavaScript file (in js/common.js), but admitted at the time that such code was uncommon. If you remember that, you might also recall that I promised it would be used site-wide in this chapter. It’s only a slight amendment, but I’m going to add in one extra line to the form helper tip code that we set up for the Contact page, and it looks like this (shown in bold):
$("#contactname").val("Please enter full name");
$("#telephone").val("Incl local dialling code");
$("#eventdate").val("Format DDMMYYYY");
$("#details").val("The more you can enter here, the less we have
to check with you :)");
$("#q, #search-box").val("Enter search phrase");
$("input, textarea").focus(function(){
$(this).select();
});