CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 How can I execute a javascript function in CC?-ASP

Print topic Send  topic

Author Message
infotba
Posted: 05/22/2002, 11:51 PM

I want to use a “Add to Favorite List” function.
I wrote this script in default.html between body section.

<SCRIPT language=JavaScript1.2>
var bookmarkurl="http://xxx.com"
var bookmarktitle="YYY Main Page"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</SCRIPT>

And the orginal code is :

<A href="javascript:addbookmark()"> </a> <A
href="javascript:addbookmark()"><FONT
face=Verdana size=1>Add To Favorite List
</FONT></A>

Now, how can I execute this javascript function in CC as a link?
(Not direct on page, just like some of an any link )
Regards,
Sixto
Posted: 05/23/2002, 12:12 AM

Add your script to the page's custom head section (form's property/header&footer).

In the form fields, add a new field, set it as Label, set
<A href="javascript:addbookmark()"><FONT face=Verdana size=1>Add To Favorite List</FONT></A>
as the field's caption, and make sure that HTML is set on the field's properties.

Regards,
Sixto
infotba
Posted: 05/23/2002, 12:50 AM

Dear Sixto,

How can I modify the "Portal Links forms" on the default page , for this ?
(Portal is CC's example )
Regards,
Sixto
Posted: 05/23/2002, 8:16 AM

Well, that's a litle different but can be solved just as easily.

As before, add your script to the custom head section of the default page.

Then add this to your Links form Open Event:

' ------------------------------
SetVar "link_name", "Add to Favorites List"
SetVar "link_name_URLLink", "javascript:addbookmark()"
Parse "DListLinks", True
' ------------------------------


This works by adding an entry to the template before the page gets the opportunity to process the links.

On the other hand, if you are not using templates, you must replace the code in Open Event with:


' ------------------------------
%>
<tr>
<td class="DataTD"><font class="DataFONT"><a href="javascript:addbookmark()"><font class="DataFONT">Add to Favorites List</font></a></font></td>
</tr>
<%
' ------------------------------

Please, notice the %> and <% codes. This way we are closing ASP code, adding HTML to the page, then re-opening ASP code.

Regards,
Sixto
Kevin A
Posted: 01/03/2003, 1:31 PM

I would guess you mean the <head> section of the main page I'll adding the href to : "Add your script to the page's custom head section (form's property/header&footer)."

When I try to run the script I get " 'window.external' is null or not an object" Javascript error yet if I create a standalone html page with the script and href it works fine.


   


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

Web Database

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.