• 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: countdown form submissions

countdown form submissions 6 years 7 months ago #37206

  • wimm72
  • wimm72's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Hi,
Anyone here who knows if its possible to display the countdown number for submissions.

I want to create a form to enroll in a course.
I can seat 10 participants and want to show automatic how many places are still available.
The administrator has disabled public write access.

countdown form submissions 6 years 7 months ago #37220

  • wimm72
  • wimm72's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Hello,
*UPDATE*
I have installed the list module and show only the {global:naturalcounter}.

Which result in

3 ..
2 ...
1 ...

Anyone here who knows how to become that only the last entry is showed ?

Like, in this case
3 ...

Best regards and thanks for reading this.
The administrator has disabled public write access.

countdown form submissions 5 years 4 months ago #38601

  • wimm72
  • wimm72's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Hi,
Limiting the number of submissions is working now, maybe it is possible to get from here what i need ?

I know this is an old topic but stil no success for me.

I just want the "number" to show from how many submissions left from form in a module.

Thanks to take the time and read this topic.
Last Edit: 5 years 4 months ago by wimm72.
The administrator has disabled public write access.

countdown form submissions 5 years 2 months ago #38753

Hello,

Just add a textbox with for example the name "counter"
Add the following code to the Default Value of the textbox:
//<code>
$max = 10;
$db = JFactory::getDbo();
$db->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE FormId='3'");
 
$submissions = $max - $db->loadResult();
return $submissions
//</code>
Remark: do not forget the tags //<code> ... //</code> to make clear that this is a php script

Where:
$max = max total submissions allowed (at this example 10)
FormId = recordnumber of Form (at his example Form with recordnumber 3)

To make the field readonly:
at Attributes - Additional Attributes add: readonly="readonly"

Success
The administrator has disabled public write access.
The following user(s) said Thank You: wimm72, info2896

countdown form submissions 5 years 2 months ago #38759

  • info2896
  • info2896's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
How can I add plain text to a script. For example, the number of registrations is:
I tried it by ECHO, but it does not work.
The administrator has disabled public write access.

countdown form submissions 5 years 2 months ago #38760

Use the following script to add text:
//<code>
$max = 10;
 $db = JFactory::getDbo();
 $db->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE FormId='3'");
 
$submissions = $max - $db->loadResult();
return  'Total remaining submissions: ' . $submissions ;
//</code>
The administrator has disabled public write access.
The following user(s) said Thank You: wimm72, info2896

countdown form submissions 5 years 2 months ago #38764

  • wimm72
  • wimm72's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Thanks you very much.

You rock
The administrator has disabled public write access.

countdown form submissions 5 years 1 month ago #38778

With the help of the perfect support of the RSJoomla Supportdesk :) an optimalisation of the script. Previous script had the formId hardcoded. Following script has formId based on form itself using $this->formId. Very convenient when you copy the form.
//<code>
$max = 10;
 $db = JFactory::getDbo();
 $db->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE FormId='".$this->formId."'");
 
$submissions = $max - $db->loadResult();
return  'Total remaining submissions: ' . $submissions ;
//</code>
The administrator has disabled public write access.
The following user(s) said Thank You: wimm72
  • 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!