function valueToPlaceHolder(divId){ // this function creates a placeholder based on the attribute 'value' of this same input text field //once done, it removes the 'value' attribute // it is useful for cforms II plugin cos placholder are not available, while default value attr are // THIS : // // would return : // // see http://stackoverflow.com/questions/11432144/change-value-to-placeholder-input-field if( document.getElementById(divId) ){ $('input[type="text"]').each(function() { var $this = $(this); $this.attr('placeholder', $this.attr('value')).removeAttr('value'); }); } }