• 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: How to limit the number of submissions to a field?

How to limit the number of submissions to a field? 9 years 8 months ago #28330

Hello,

I want to create a form for a event and I would like to limit the number of submissions for some particular fields. I don't have found any script to do this, there are only scripts to limit the nomber of submissions to a form.

Could you help me ?

Thank you.
The administrator has disabled public write access.

How to limit the number of submissions to a field? 9 years 8 months ago #28333

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
You can invalidate a form using a query to count how many submissions were made for that specific field. Try using this code in scripts called on form process:
$db = JFactory::getDbo();
$db->setQuery("SELECT COUNT(`FieldValue`) FROM #__rsform_submission_values WHERE `FieldName` = 'name_of_field' AND `FormId`='". (int) $formId."'");
$count = $db->loadResult();
 
if ($count > insert_limit_here)
$invalid[] = RSFormProHelper::getComponentId("name_of_field");

PS: a more appropriate solution would be to create a script like the one from the example below:

http://www.rsjoomla.com/support/documentation/view-article/373-limit-the-number-of-submissions-to-a-form.html
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.

How to limit the number of submissions to a field? 9 years 8 months ago #28381

  • kareez
  • kareez's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
Hi
I created a form and set a dropdown list in it. Name of this dropdown list is group.
This dropdown list includ three Items.

I used your code but not work.
I want create capacity limitation for each item of dropdown.
Please help me.
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!