• 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: Automatic stop after #number for dropdownfield

Automatic stop after #number for dropdownfield 11 years 11 months ago #23580

Hello I'm new here,

In advance, thanx for your time.

I've got a site with a form were people can apply for a specific date.
The different dates are in a dropdownbox. The thing is, that after 30 people signed up for 1 of the dates, I need to manually remove that date.. Problem is, if I don't pay attention i've got to many people coming.

Is there a way that I can make them sign up for a specific date and if I got 30 applies it wil remove itselve?

Hope that I explaned it so you could help me out a bit. If you would like te see the form go to http://www.apenkooigym.nl/meld-je-aan But it is in dutch.

Hope there is somebody that could give me an idea to solve this time robbing problem of mine.

Thnx
Han
The administrator has disabled public write access.

Automatic stop after #number for dropdownfield 11 years 10 months ago #23584

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
This can only be achieved using custom scripting, as there is no default feature offering such functionality.

Please add the following code:

$database = JFactory::getDBO();
$date=$_POST;
$database->setQuery("SELECT COUNT( `FieldName` )
FROM #__rsform_submission_values
WHERE `formId` = '1'
AND `FieldName` = 'calendarfield'
AND `FieldValue` = '$date'");
$database->query();
$nr=$database->loadResult();
if ($nr > 30) $invalid[] = RSFormProHelper::getComponentId("ContactBy");

in Components >> RSForm!Pro >> Manage Forms >> edit your form >> Properties >> PHP Scripts >> 'Scripts called on form process' area.

Note that, for the script to work, you need to replace 'formid' with your form's actual id and 'calendarfield' with the name of your calendar field.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
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!