Sort fields in ascending order.

 This is done with some javascript hack because the fields are dependent on their assigned index that needs to remain constant.