Revision: 30991
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 26, 2010 23:19 by andyweb
Initial Code
var formEl = '#main .contact_form'; if( $(formEl).length >0 ){ var labelArray = new Array(); for(i=0 ; i<$(formEl+' .inputText').length ; i++){ labelArray[i] = $(formEl+' .inputText:eq('+i+')').attr('value'); } $(formEl+' .inputText').focus( function(){ index = $(formEl+' .inputText').index(this); if( $(this).attr('value') == labelArray[index] ){ $(this).attr('value',''); } }).blur(function(){ index = $(formEl+' .inputText').index(this); if( ($(this).attr('value') == labelArray[index]) || ( $(this).attr('value') == '') ){ $(this).attr('value',labelArray[index]); } }); }
Initial URL
Initial Description
Show/hide labels on focus/blur when using form values as labels.
Initial Title
Form label value show/hide
Initial Tags
Initial Language
jQuery