CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Changing hyperlinks with template variables

Print topic Send  topic

Author Message
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.

View profile  Send private message
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", ""
View profile  Send private message
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/
>


Add new topic Subscribe to topic   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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