• 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: Counter start with other number than 1

Counter start with other number than 1 4 years 7 months ago #40548

  • info2144
  • info2144's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
In my form I have a hidden field "counter" for the submissions. I'm not good with PHP and I can't find the code to let the counter starts with another number than 1. I want to fill in a number (say 32), so the counter starts with 33. After that he normally goes up with 1, so the next submission is 34, 35 etc.
The code I have now is:
$db = JFactory::getDbo();
$db->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE FormId='".(int) $formId."'");
$_POST['form']['counter'] = $db->loadResult()+1;

Can someone help me to change the code?
Thank you!
The administrator has disabled public write access.

Counter start with other number than 1 4 years 7 months ago #40551

  • dragos
  • dragos's Avatar
  • OFFLINE
  • Administrator
  • Posts: 634
  • Thank you received: 117
Hello,

You just need to replace:
$_POST['form']['counter'] = $db->loadResult()+1;

with:
$_POST['form']['counter'] = $db->loadResult()+32;
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!