This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Form List Sort Method


  1. gnoiec
    Member

    Is there any way to sort the list of forms that I created? It defaults to the very first form I created (which is no longer active), and I have to go to page 2 to access my current form.

    Thanks,
    Matt

    Posted 15 years ago #
  2. redityo

    Hi Matt,

    What order do you need ? by default machform have form list order by form_id. You can change the order by editing "manage_form.php", try to search on line 105 and you will see this code :

    $query = "select form_id,form_name,form_active,form_email from
     <back>ap_forms<back> order by form_id asc $limit";

    if you want to order by form name you can change it to

    $query = "select form_id,form_name,form_active,form_email from
     <back>ap_forms<back> order by form_name asc $limit";

    and make sure you've replace <back> tag with backticks character first


    MachForm Support

    Posted 15 years ago #
  3. gnoiec
    Member

    Thank you. That is exactly what I was looking for. One more question though. Am I strictly limited to the variables form_id, name, active, and email? Or are there others? (for example, date_created)

    Thanks for your help,
    Matt

    Posted 15 years ago #
  4. yuniar

    Actually, there are other variables, however I don't think the other variables would be relevant for sorting your form (ex: form_description, form_redirect, form_success_message, etc)

    If you need to sort by date created, then using form_id would have the same effect. form_id is a sequential number.


    MachForm Founder

    Posted 15 years ago #
  5. tom472
    Member

    What might be helpful to gnioec in reference to his question about sorting by 'date_created' - correct as you mentioned form _id would be the same.
    But it sounds like gnioec has his latest created forms as his current ones, so just a reverse on the default sort might do the trick. Like this:

    $query = "select form_id,form_name,form_active,form_email from
     <back>ap_forms<back> order by form_id desc $limit";

    Just a thought.

    --Tom

    Posted 15 years ago #

RSS feed for this topic

Reply