CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 open in a new window

Print topic Send  topic

Author Message
telmiger

Posts: 61
Posted: 10/10/2005, 7:22 AM

I am displaying my data in a updatable grid. Because I have many link associcated with each record of my updateable grid I use a selection box to store my links instead of using regular links.

To make this work I use the code below in the on change event of the selection box. This works great but I can not figure out how to change the last line so that the page will open up in a new window.
I tried to icorporate several code samples that open up new windows into the code below but without sucess. (I am no javascript hero)

var name;
var len;
var id;
var pos;
name = this.name;
len = this.name.length;
pos = name.lastIndexOf("_");
id = name.substr(pos+1, len-pos);
// build Hidden field full name
var corr_name = "Hidden1_" +id;
// get the hidden element
var Tnames = document.getElementsByName(corr_name);
//value="New Window!"
window.location = this.value+"?project_charge_id= " + Tnames[0].value;
View profile  Send private message
Walter Kempees
Posted: 10/10/2005, 1:53 PM

I am no JS expert but window.location is code for a redirect, actualy it's
holding the url for the current page.
Redirect will always be in the same browser window.
however, I Googled you this example, have fun.

  
<head>  
<script language="JavaScript">  
<!--  
myWindow = window.open("http://www.voordeel4u.nl/", "tinyWindow",   
'toolbar,width=150,height=100')  
myWindow.document.write("Welcome to this new window!")  
myWindow.document.bgColor="lightblue"  
myWindow.document.close()  
//-->  
</script>  
</head>  
  
  


Walter

"telmiger" <telmiger@forum.codecharge> schreef in bericht
news:5434a791a0e0b7@news.codecharge.com...
>I am displaying my data in a updatable grid. Because I have many link
> associcated with each record of my updateable grid I use a selection box
> to
> store my links instead of using regular links.
>
> To make this work I use the code below in the on change event of the
> selection
> box. This works great but I can not figure out how to change the last line
> so
> that the page will open up in a new window.
> I tried to icorporate several code samples that open up new windows into
> the
> code below but without sucess. (I am no javascript hero)
>
> var name;
> var len;
> var id;
> var pos;
> name = this.name;
> len = this.name.length;
> pos = name.lastIndexOf("_");
> id = name.substr(pos+1, len-pos);
> // build Hidden field full name
> var corr_name = "Hidden1_" +id;
> // get the hidden element
> var Tnames = document.getElementsByName(corr_name);
> //value="New Window!"
> window.location = this.value+"?project_charge_id= " + Tnames[0].value;
> ---------------------------------------
> 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.

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.