Posted By

iamntz on 08/07/09


Tagged

niceforms


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rickfu


Niceforms jQuery alternative (js)


 / Published in: jQuery
 

URL: iamntz.com

the css: http://snipplr.com/view/18037/niceforms-alternative-css/

  1. $('#addcomment input, #addcomment textarea').each(function(){
  2. var t=$(this);
  3. t.wrap('<tr><td class="inner"></td></tr>').parents('tr:first').prepend('<td class="ml"></td>').append('<td class="mr"></td>').wrap('<div class="ntzForms"><table></table></div>').before('<tr><td class="tl"></td><td class="tt"></td><td class="tr"></td></tr>').after('<tr><td class="bl"></td><td class="bb"></td><td class="br"></td></tr>');
  4. t.parents('.ntzForms:first').addClass(t.attr('class'));
  5. t.focus(function(){
  6. t.parents('.ntzForms:first').addClass('focus');
  7. }).blur(function(){
  8. t.parents('.ntzForms:first').removeClass('focus');
  9. });
  10. });

Report this snippet  

You need to login to post a comment.