CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Email mailto: links in CCS ?

Print topic Send  topic

Author Message
Zip
Posted: 01/06/2003, 4:12 AM

I a grid i have a label called email, set to html content. I want this to
be a mailto: link, but i cant get it to work.

In the before show row event of the grid i have:

global $email;
$email="<a href=\"mailto:$email\">$email</a>";

But nothing happens.

Any suggestions ???
RonB
Posted: 01/06/2003, 8:33 AM

Use the before show event

global $yourgridname;
$yourgridname->email->setvalue("<a href='mailto:" .$yourgridname->email->Value ."'>");

In php that is.

That should do the trick

Ron
Zip
Posted: 01/07/2003, 6:28 AM

Yep, that does the trick.

But i would like the email to be visible as a link also. I have tried different ways but without luck.

global $members;
$email_link = $members->email->setvalue;
$members->email->setvalue("<a href='mailto: ".$members->email->Value."' > ".$email_link." </a>");

RonB
Posted: 01/07/2003, 8:05 AM

"global $members;
$email_link = $members->email->setvalue;
$members->email->setvalue("<a href='mailto: ".$members->email->Value."' > ".$email_link." </a>");"

The way to call an object is very important. Also the functions you use to do something with the values, members of that object contain.

Getting the value of a member:
global $gridname
$gridname->membername(control label etc)->Value or
$gridname->membername(control label etc)->GetValue()
See the programming reference for differences
so the code for your email would become:

global $members;
$members->email->setvalue("<a href='mailto: ".$members->email->Value ."' >" .$members->email->Value ."</a>");

That should work

Ron
Zip
Posted: 01/07/2003, 12:39 PM

Arrgh, this is making my hair grey..

I have tried to do as you said, but without luck.

In my grid, i want the email to be a mailto: link. the email label is set to html content. In the grid before show i have placed as you wrote

global $members;
$members->email->setvalue("<a href='mailto: ".$members->email->Value ."' >" .$members->email->Value ."</a>");

But all i get is a plain lable with the email, no link, and no mailto:

What can i possibly have done wrong, this seems to be such a straight forward thing, and i am not able to make it work. :(
RonB
Posted: 01/07/2003, 2:28 PM

Oke,

I made a tabel members in my database with two fields, id and email so the code would be identical for the mailto link.

In the before show for the label, NOT THE GRID, I added the code as I posted earlier. The entry in the email field from the database now shows as a link in my grid.

Please check if you put the code in a beforeshow event for the email label and not by mistake in a beforeshow event for the grid.

If that is not the case...publish the site and in your browser look at the source html. Does it show the <a href='mailto:someadres@yourdatabse.com'>someadres@yourdatabse.com'</a> ?

Check if the datatype is set to text for the label (as the content, you said, was set to html)

If you still aren't getting the link we are getting into serious voodoo country :-)

Ron
Zip
Posted: 01/08/2003, 1:53 AM

First, i realy apreciate your help. And its close now.. This i have in my before show on the email label set to content text:

global $members;
$members->email->setvalue("<a href='mailto: ".$members->email->Value."'>" .$members->email->Value ."</a>");

This i what i see in the browser window:

<a href='mailto:this@that.dk>this@that.dk'</a>

This is what i see in the html source:
<a href='mailto:mb@formidling.dk>mb@formidling.dk'</a>

Why does the <> not get translated into html ??





RonB
Posted: 01/08/2003, 4:45 AM

<a href='mailto:this@that.dk>this@that.dk'</a>

What strikes me is the'in that bit of code. Where the h*ll is that coming from?
It's not in the event code:
global $members;
$members->email->setvalue("<a href='mailto: ".$members->email->Value ."'>" .$members->email->Value ."</a>");
Somehow the ' is misplaced in the proces. It should be before the first >
Try this code (it worked for me in the testpage):

global $members;
$members->email->setvalue("<a href=mailto:" .$members->email->Value .">" .$members->email->Value ."</a>");


Now there's no 'to be found so it cant get misplaced :-)
I've got a feeling that's the problem.

Let me now if it works. Still it's strange because the original code is the same as on my testpage and the 'isn't being misplaced on my page... Oh well.

Ron
-
Posted: 01/08/2003, 5:29 PM

... and don't forget to set the Content property of the label to HTML ?
Zip
Posted: 01/09/2003, 2:39 AM

Ahhhh... NOW its working. And thanks for all your help. This calls for a glass of 20year-old port. :)
gb
Posted: 01/23/2003, 1:44 AM

You have to set the Content to HTML instead of text.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.