BrianOg
Posts: 5
|
| Posted: 06/23/2006, 10:32 AM |
|
I have created a form with a link on it.
The source of the form is a mySQL table which has a field in it either containing a URL, or a null.
If the field contains a URL, I want to set the href of the form's link to it, if the field contains a null, I want the href set to another page on my site (always the same page)
I have been trying to use template variables to do this.
The HTML coding is:
<td align="right" width="8%"><a href="{LnkStats_Src}" {stats_tpl_var}>{LnkStats}</a></td>
I have put the following code into the beforeshow event of the form:
If trim(tblschools1.txtStats.Value) <> "" Then
tblschools1.LnkStats.Page = tblschools1.txtStats.Value
tblschools1.LnkStats.Value = "STATS"
HTMLTemplate.SetVar "@stats_tpl_var", "target=_blank"
Else
tblschools1.LnkStats.Page="SchoolsLinks.asp"
tblschools1.LnkStats.Value = "Other Text"
HTMLTemplate.SetVar "@my_tpl_var", ""
End If
As you can see, if the link is to a page on another site, I want it to appear in a new window ("target = _blank")
The link is always blank on the page, whether the database field contains a web address or not.
Can anyone tell me where I'm going wrong? I am a newbie as far as ASP and CCS is concerned.
Maybe there is a better way to do it, not using template variables.
|
 |
 |
BrianOg
Posts: 5
|
| Posted: 06/23/2006, 10:35 AM |
|
Sorry, there was an error in my previous message.
In the Else section of the coding, the penultimate line should have read
HTMLTemplate.SetVar "@stats_tpl_var", ""
|
 |
 |
DonB
|
| Posted: 06/24/2006, 9:37 PM |
|
You didn't quote the '_blank'. Could that be all that is wrong?
--
DonB
http://www.gotodon.com/ccbth
"BrianOg" <BrianOg@forum.codecharge> wrote in message
news:6449c265718849@news.codecharge.com...
> Sorry, there was an error in my previous message.
> In the Else section of the coding, the penultimate line should have read
>
> HTMLTemplate.SetVar "@stats_tpl_var", ""
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|