• 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: echo date

echo date 9 years 7 months ago #32583

  • stavroch
  • stavroch's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
How can I display in a form the 'current year' - 'plus one year more'

ex: 2015 - 2016
The administrator has disabled public write access.

echo date 9 years 7 months ago #32590

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
This should provide some assistance with date operations:

http://php.net/manual/en/function.date.php
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.

echo date 9 years 7 months ago #32592

  • stavroch
  • stavroch's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
My question is how can I parse php code
for example the <?php echo "text" ?>

in rs form how can I use such a php code?
The administrator has disabled public write access.

echo date 9 years 7 months ago #32595

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

If you want to use this within a textbox, edit the textbox and add something like (including the //<code> tags) within its Default Value area:
//<code>
$currYear = date('Y');
$nextYear = (int) $currYear+1;
return $currYear.' - '.$nextYear;
//</code>

Otherwise, if you want it displayed as plain text, you can use a similar script within "Scripts Called on Form Display" area (while editing a form > Properties > PHP Scripts).
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

echo date 9 years 7 months ago #32596

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
You have been using RSForm!Pro for quite some time, and have numerous examples about how to implement PHP scripting in your support tickets, but if that isn't enough, i will explain:

- each field can use PHP code to populate its value section, via the Default Value option (Items section for dropdowns, radios, checkboxes). This is explained for each field type here:

https://www.rsjoomla.com/support/documentation/rsform-pro/form-fields.html

- RSForm!Pro also incorporates various PHP scripting section that are triggered at various points within the execution flow. Explanations here:

https://www.rsjoomla.com/support/documentation/rsform-pro/customizing-rsform-pro/custom-php-code.html
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!