# Link from variable in textfield?

**URL:** <https://forum.kirupa.com/t/link-from-variable-in-textfield/137401>\
**Category:** Uncategorized\
**Created:** [February 14, 2005, 10:19am UTC](https://forum.kirupa.com/t/link-from-variable-in-textfield/137401 "2005-02-14T10:19:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cakeman](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@Cakeman](https://forum.kirupa.com/u/Cakeman)\
**Post date:** [February 14, 2005, 10:19am UTC](https://forum.kirupa.com/t/link-from-variable-in-textfield/137401/1 "2005-02-14T10:19:29Z")

</div>

Hi,

I’m trying to get a variable that I get from a PHP-script to be a link in a textfield.

Right now I’m using an html tag to make a link to the information I want to display…

This works but I think its not good enough… I want to get a “ **rollOver** ” function on the Headline instead of a new line that says click me.

The following code displays in the textfield “content”:

**News**

**Headline \<–Headline from the database**  
**Teaser \<-- Text from the database**  
\*\*Click me \<-- Html link that displays the full text in a textfeild called “info” \*\*

**Headline**  
**Teaser**  
**Click me**

**…**

```auto
 
function act(paramString) {
 
var params = paramString.split("#");
content.htmlText(params[0]);
 
info.htmlText = unescape(params[1]); }
 
function showValues() {
content.text = "News 

";
for (i=0; i < this.n; i++){
 
content.htmlText += this["headline"+i] + this["teaser"+i] + "<br>" + "<a href='asfunction:act," + this["actId"+i] + "#" + escape(this["text"+i]) 
+"'> <font color='#000000'>Click this link</font></a><br><br>";
}
}
 
var c = new LoadVars();
c.onLoad = showValues;
c.load("my_PHP_fil.php");
stop();

```

**I want it to look like this:**

**News**

**Headline**  
**Teaser**

**Headline**  
**Teaser**

**…**

And the text in the headline should be the link…

Please help me!

/Marcus
