• 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: hyperlink for a textbox

hyperlink for a textbox 2 months 1 week ago #39192

Hello,

I'm using a directory to display members their subscription.
I'm using the auto generate layout of the directory of my form.


I would like to have the url field with hyperlink. By clicking it will go to the url.

How should I do this ?

Regards

Nicolas
The administrator has disabled public write access.

hyperlink for a textbox 1 month 3 weeks ago #39260

  • bogdan.tataru
  • bogdan.tataru's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 127
  • Thank you received: 32
Hello,

Please follow these steps:

- head to backend > Components > RSForm!Pro > Manage Directories > your form directory > PHP Scripts > within "Scripts called on Listing Layout"

- add a snippet as the following:
$pattern = '#directoryColLien-internet">.*?</td>#';
if (preg_match_all($pattern, $directoryLayout, $matches)){
    foreach ($matches[0] as $i => $fullMatch){
        $shrink = substr($fullMatch, 0, -5);
        $string = explode(">",$shrink);
        $yourHref = $string[0].'><a href="'.$string[1].'">'.$string[1].'</a></td>';
        $directoryLayout = str_replace($fullMatch, $yourHref , $directoryLayout);
    }
}

Note that you will have to replace "directoryColLien-interne" with the id of the column where the URL is displayed. You can find this by inspecting the table cell that holds your URL.

Afterwards test this one more time.
My help is not official customer support. To receive assistance, submit a ticket by clicking here
The administrator has disabled public write access.
The following user(s) said Thank You: madoshinatsu

hyperlink for a textbox 1 month 3 weeks ago #39262

Hi bogdan

Thank you a lot for your reply.

Do you mean the fieldname when you tell to change "directoryColLien-internet" by the id of the field ?

In my form the fieldname is "txtUrl1" in the table chdg4_rsform_submission_values.

I tried to replace
$pattern = '#directoryColLien-internet">.*?</td>#';
with
$pattern = '#txtUrl1">.*?</td>#';

but it doesn't do anything.

I tried to display the content of $directoryLayout to see witch id is displayed but I can't.

Where can I find the id of my field ?

Best regards

Nicolas
The administrator has disabled public write access.

hyperlink for a textbox 1 month 3 weeks ago #39263

I find ;)

$pattern = '#directoryColTxturl1">.*?</td>#';
if (preg_match_all($pattern, $directoryLayout, $matches)){
    foreach ($matches[0] as $i => $fullMatch){
        $shrink = substr($fullMatch, 0, -5);
        $string = explode(">",$shrink);
        $yourHref = $string[0].'><a href="'.$string[1].'">'.$string[1].'</a></td>';
        $directoryLayout = str_replace($fullMatch, $yourHref , $directoryLayout);
    }
}

We should keep "#directoryCol<fieldname>"

and to display the content of $directoryLayout variable I used
echo '<textarea class="box">'.$directoryLayout.'</textarea>';
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!