This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 4
Show how many spots are left (Limit Form Submission)
Started 9 years ago by presbyran | 4 posts |
-
Hi
Just wanna know if there is any way how to show how many entries are left for the form.
Example:
I create a form and allow max 5 entries to be saved before the form gets disabled.
I wanna show on the form that there is 3 enries left of 5 for the users, so they know how many spots are left.Is this possible?
Thanks
Posted 9 years ago # -
Nobody?
Posted 9 years ago # -
That would be an awesome feature!!
Posted 9 years ago # -
I'm afraid currently there is no function to show remaining entries on the form.
But if you don't mind with the customization, you can create custom code to show remaining entries in the top of your forms.To do this, edit includes/view-functions.php file and go to around line 5324, you will see these codes :
//if advanced form code being used, display the form without body container if($integration_method == 'php'){
then put these custom code above that line
//custom code if ( !empty($form->limit_enable) && $form->limit_enable == 1){ $query = "select count(1) total_entries from ".MF_TABLE_PREFIX."form_{$form_id} where <code>status</code> = 1"; $params = array(); $sth = mf_do_query($query,$params,$dbh); $row = mf_do_fetch_result($sth); $remain_count = $form->limit - $row['total_entries']; $remain_entries_message = <<<EOT <li class="remain_entries"> Remain {$remain_count} entries of {$form->limit } </li> EOT; }
then go to line 5380 and 5428, you will see these code :
{$payment_total_markup_top}
and change the code to be like this
{$payment_total_markup_top} {$remain_entries_message}
MachForm Support
Posted 9 years ago #
Reply
You must log in to post.