Creating Url Links Inside List Box

I’m new to Yii…but love it! Have a background in Oracle and Java, data modeling etc.

I have a page with 2 multiselect list boxes I populate with a function that returns a list using CHtml::listData($data,‘id’,‘site_url’);

The site_url is a string (eg. "www.yiiframework.com") and I would like it to be a clickable link when in the

multiselect list box.

I can’t seem to get the url to be linkable, tried to transform the data when I create the list but it gives me problems.

Any suggestions as to using CHtml::Link() or other options?

I have buttons that move items from list_1 to list_2 and back…was thinking I might allow the user to select one

item and click a button to go to the website but it seems that it would be easier to do it in a more native fashion

rather than have to write a bunch of code to check for just one item being selected and then opening a window to the url.

Thanks for any advice.

Hi AustinGeek.

You could set the link in no appeared state with:

CHtml::link("Yii link","http://www.yiiframework.com",array("id"=>"linkid1", "style"=>"display:none;")); ?>

when the listboxes are selected, set the "linkid1" style to display:block with javascript

Thanks Konapaz - I will give it a try. I didn’t think there was any reason a link could not be in a list but just

could not get it to work with a variety of different attempts.

FYI - I love Greece - spent a month there back in 2000…Naxos, Paros…very nice!