Remember me

How to make letters lowercase and replace spaces in a field?

5 months 1 week ago #1

  • G.'s Avatar
  • G.
  • Posts: 510
Hi, in my form with two dropdown fields I set the submit button as "redirect".
In the "link" field I entered "/[Field ID=1]/[Field ID=2]".
The values ​​of [Field ID=1] and [Field ID=2] have some upper case letters which is not good for links. Also, I should replace spaces with "-".
Can you help me with some custom code?
Thank you very much.

5 months 6 days ago #2

  • Viacheslav's Avatar
  • Viacheslav
  • Posts: 28858
Hello,
Thank you for contacting us

Unfortunately there is no such option

Regards,
Vyacheslav, Balbooa.com

5 months 6 days ago #3

  • G.'s Avatar
  • G.
  • Posts: 510
Could you help me by using a custom code

5 months 6 days ago #4

  • Viacheslav's Avatar
  • Viacheslav
  • Posts: 28858
You need to find and replace the code in this file
form.php (\com_baforms\models\form.php)
Replace with this code:
$link = baformsHelper::renderDefaultValue($submit->options->link);
=>
$link = str_replace(' ', '-', strtolower(baformsHelper::renderDefaultValue($submit->options->link)));

Regards,
Vyacheslav, Balbooa.com
Powered by Kunena Forum