• 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: compare dates from to date fields

compare dates from to date fields 11 years 7 months ago #24973

Hello,

how can i compare to date fields? The second date should always be higher then the first. If not should appear a error message.
Is it possible?

Thanks, Michael
The administrator has disabled public write access.

compare dates from to date fields 11 years 7 months ago #24982

Hello Michael,

This can be achieved by placing a PHP Script called on form process to check for your custom condition and invalidate the field if the condition is not met.

The script in question will have to be placed in the Components > RSForm!Pro > Manage Forms > edit the form > PHP Scripts in the Scripts Called on Form Process area (second textarea).

As for the script, something like the following can be used:
if(strtotime($_POST['form']['End']) < strtotime($_POST['form']['Start']))
{
    $invalid[] = RSFormProHelper::getComponentId("End");
}

Please remember to adjust the values to be relevant to your specific scenario.

For more information about RSForm!Pro's PHP Scripting features, please refer to the following article:

www.rsjoomla.com/support/documentation/v...602-php-scripts.html
Please remember that my responses aren't considered customer support, to receive customer support please submit a new customer support ticket, and we will gladly assist you.

Best Regards,
Cristian Nicolae.
Last Edit: 11 years 7 months ago by cristian.nicolae.
The administrator has disabled public write access.
The following user(s) said Thank You: Michael.Anlauf

compare dates from to date fields 11 years 6 months ago #25260

  • adoewa
  • adoewa's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
Am i correct i need to replace 'form' with my formname and 'End' with my fieldname?
The administrator has disabled public write access.

compare dates from to date fields 6 years 10 months ago #38307

  • tom_vanbrabant
  • tom_vanbrabant's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 4
Hello.. I have the same issue.. Were you able to get this to work?
What needs to be replaced inside the code snippet?
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!