Answers.Body: <p>Here's an example of moving #mycustomfields ahead of a .core-class:</p>
  
  <pre><code>function Refresh() {
    cj(function ($) {
      'use strict';
        /* move my custom fields up where they belong */
        $('.core-class').prepend($('#mycustomfields'));
    });
  }
  </code></pre>
  
  <p>Open up an inspector tool for your browser to find the # or the . you'd like to move around using JavaScript. In Firefox I like Firebug: <a href="http://getfirebug.com/" rel="nofollow">http://getfirebug.com/</a></p>
  
  <p>In the example above I'm moving an entire div with id=mycustomfields.</p>
  
  <p>@Josh ended up using:
  'cj('#editrow-custom_25').insertBefore('.editrow_prefix_id-section');'</p>
  
  <p>Many ways to re-order change things up in jQuery!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-22T22:11:37.023Z
Answers.Text: Sorry I am very new at this. What name goes in #mycustomfields. Thanks!
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-22T22:44:53.780Z
Answers.Text: Hey Josh - I've added a bit more detail in my answer!
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-22T23:17:27.043Z
Answers.Text: Karin,  Thank you very much.  But I am not sure what I am doing wrong.  !(https://drive.google.com/file/d/0B7XPtgJEnqAoRlZ6TXpGaXZUVUU/view?usp=sharing)  The code I am using is `{literal}
  <script type="text/javascript">
   cj('#editrow-custom_24').appendTo('.honoree-name-email-section');
   cj('#editrow-custom_25').appendTo('.honoree-name-email-section');
  function Refresh() {
    cj(function ($) {
      'use strict';
        /* move my custom fields up where they belong */
        $('.core-class').prepend($('#editrow-custom_25'));
    });
  }
  </script>
  {/literal}`
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-22T23:26:33.960Z
Answers.Text: I think perhaps you want prepend instead of appendTo? See also: http://www.w3schools.com/jquery/html_prepend.asp
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-23T00:50:09.873Z
Answers.Text: Karin,  I appreciate all your help.  When I change appendTo to prepend the field no longer  shows up in the correct profile at all.  The code looks like `cj('#editrow-custom_25').prepend('.honoree-name-email-section');` Thanks!
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-23T09:42:01.940Z
Answers.Text: As a sidenote, the new jQuery container for Civi is CRM.$ ?
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-23T20:36:51.820Z
Answers.Text: I figured it out.  All with one line of code. 'cj('#editrow-custom_25').insertBefore('.editrow_prefix_id-section');'
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-23T21:36:58.517Z
Answers.Text: Ah insertBefore - that's cool! Many ways to jQuery.
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-22T22:04:27.997Z
Answers.LastActivityDate: 2016-05-23T21:52:18.260Z
Answers.LastEditDate: 2016-05-23T21:52:18.260Z
Answers.UserDisplayName: KarinG - Semper IT
Body: <p>I have appended a field to honoree-name-email-section and it works great.  However it appends to the bottom of the fields. I would like to append a field an have it be shown at the top of the list.  Is there a way to do this?</p>
  
  <p>Thanks!</p>
  
Tags: <civicontribute>
Title: Reordering Fields Appended With jQuery
ThreadText: # Reordering Fields Appended With jQuery
  
  (Asked by: username_0 on 2016-05-22)
  
  I have appended a field to honoree-name-email-section and it works great. However it appends to the bottom of the fields. I would like to append a field an have it be shown at the top of the list. Is there a way to do this?
  
  Thanks!
  
  **Tags:** civicontribute
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-22. Score: 2 | Accepted answer
  
  Here's an example of moving #mycustomfields ahead of a .core-class:
  function Refresh() {
    cj(function ($) {
      'use strict';
        /* move my custom fields up where they belong */
        $('.core-class').prepend($('#mycustomfields'));
    });
  }
  
  Open up an inspector tool for your browser to find the # or the . you'd like to move around using JavaScript. In Firefox I like Firebug: http://getfirebug.com/
  In the example above I'm moving an entire div with id=mycustomfields.
  @username_0 ended up using:
  'cj('#editrow-custom_25').insertBefore('.editrow_prefix_id-section');'
  Many ways to re-order change things up in jQuery!
  
  > **Comments:**
  > **username_0**: Sorry I am very new at this. What name goes in #mycustomfields. Thanks!  
  > **username_1**: Hey username_0 - I've added a bit more detail in my answer!  
  > **username_0**: Karin,  Thank you very much.  But I am not sure what I am doing wrong.  !(https://drive.google.com/file/d/0B7XPtgJEnqAoRlZ6TXpGaXZUVUU/view?usp=sharing)  The code I am using is `{literal} <script type="text/javascript">  cj('#editrow-custom_24').appendTo('.honoree-name-email-section');  cj('#editrow-custom_25').appendTo('.honoree-name-email-section'); function Refresh() {   cj(function ($) {     'use strict';       /* move my custom fields up where they belong */       $('.core-class').prepend($('#editrow-custom_25'));   }); } </script> {/literal}`  
  > **username_1**: I think perhaps you want prepend instead of appendTo? See also: http://www.w3schools.com/jquery/html_prepend.asp  
  > **username_0**: Karin,  I appreciate all your help.  When I change appendTo to prepend the field no longer  shows up in the correct profile at all.  The code looks like `cj('#editrow-custom_25').prepend('.honoree-name-email-section');` Thanks!  
  > **username_2**: As a sidenote, the new jQuery container for Civi is CRM.$ ?  
  > **username_0**: I figured it out.  All with one line of code. 'cj('#editrow-custom_25').insertBefore('.editrow_prefix_id-section');'  
  > **username_1**: Ah insertBefore - that's cool! Many ways to jQuery.  
  
  ---
  
  