Advertisement
Guest User

Untitled

a guest
Mar 19th, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // for: http://www.gravityhelp.com/forums/topic/address-labels-below-fields#post-175408
  2. // copied from here: view-source:http://dev.calgunsfoundation.org/get-help/hotline/
  3. // discussed here: http://stackoverflow.com/q/15490308
  4. // add the script below to an HTML block in your form
  5. <script type="text/javascript">
  6. jQuery('.ginput_container label').each(function(i,e){
  7.               fielddesc = jQuery('<div>').append(jQuery(e).clone()).remove().html();
  8.               jQuery(e).siblings('.ginput_container input[type=email]').before(fielddesc);
  9.               jQuery(e).siblings('.ginput_container input:text').before(fielddesc); //moves sub label above input fields
  10.               jQuery(e).siblings('.ginput_container select').before(fielddesc); //moves sub label above select fields (e.g. country drop-down)
  11.               jQuery(e).siblings('.ginput_container .gfield_radio input').after(fielddesc); //keep label above radio buttons
  12.               jQuery(e).siblings('.ginput_container .gfield_checkbox input').after(fielddesc);
  13.               jQuery(e).remove();
  14.           });
  15. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement