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
Started 15 years ago by gnoiec | 5 posts |
-
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,
MattPosted 15 years ago # -
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 # -
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,
MattPosted 15 years ago # -
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 # -
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 #
Reply
You must log in to post.