Unfortunately, the username and password you have entered do not match!

Registration

Unfortunately, this username is already taken!

Unfortunately, this e-mail address is already used!

Please retype the verification code.

All fields are required

RSForm!Pro - Limit the number of submissions to a form

Limit the number of submissions to a form

Limiting the number of submissions to a particular event can prove useful, when you are using the form as a subscription form for example. To achieve this, a script in the Scripts called on form display area is required:

global $database;
$database = JFactory::getDBO();
$database->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE `formId`='2'");
$database->query();
if (intval($database->loadResult()) >= 50)
{
     echo 'Sorry, no more submissions are accepted !';
     $formLayout = '';
}

The above example will limit the submissions for the form that has id = 2. If the limit is reached (50 submissions in this example) the actual form will be replaced with a warning message.

Feedback