• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Limit a registration form

Limit a registration form 3 weeks 10 hours ago #44224

  • patser77
  • patser77's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hello,
In a registration form limited to 50 people, how can I check before the form is submitted that the limit of 50 people has not been exceeded?
The administrator has disabled public write access.

Limit a registration form 3 weeks 6 hours ago #44225

  • gregs
  • gregs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 91
  • Thank you received: 5
In that form’s Form Properties screen look under “Form Info” and enter 50 in the “ Limit Submissions” field.
The administrator has disabled public write access.

Limit a registration form 3 weeks 4 hours ago #44226

  • patser77
  • patser77's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Thank you for your response, but I need to control the number of people who register on my form; this number of people is variable, so the submission limit is not valid in my case.
The administrator has disabled public write access.

Limit a registration form 2 weeks 6 days ago #44227

  • patser77
  • patser77's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hello,

to clarify my request:
I want to limit the number of people who register on a form. This number is variable. I'm using this script to test the number of people when the form opens.
$max = 36;
 
/ // Get a connection to the database.
 
$db = JFactory::getDbo();
 
/ // Configure the query. This query totals the number of participants in the current form.
// $formId contains the ID of the current form.
 
$db->setQuery("SELECT SUM(`FieldValue`) FROM #__rsform_submission_values ​​WHERE `FormId`='".(int) $formId."'"." AND `FieldName`='Totalparticipants'");
 
$counter = $db->loadResult();
 
$formLayout .= "Number of registered participants: " . $counter . "/36";
 
if ($counter >= $max) {
$formLayout = 'The maximum number of participants has been reached.';
 
} 
This works perfectly when the form is opened.

Is there a way to test this maximum number when processing the form?
For example: if a participant tries to register 2 places when there is only 1 left, it should be possible to cancel the registration or display a message informing them that only one place remain.
Last Edit: 2 weeks 6 days ago by patser77.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!