Advertisement
perazite

Contao: Newsletter clear input form fields

Mar 14th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mcp_responsive.js
  2.  
  3. (To clear input form fields)
  4.  
  5. function newsletterForm(){
  6.     if($('#newsletterForm')[0]){
  7.     $('#newsletterForm input[type=text]').each(function(){
  8.         var input = $(this);
  9.         input.data('label', input.val());
  10.         input.focus(function() {
  11.         input.val('');
  12.         }).blur(function() {       
  13.         if(input.val() == '')
  14.            input.val(input.data('label'));
  15.         });
  16.     });
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement