CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> IDE/GUI

 Add Popup Window To Input Button

Print topic Send  topic

Author Message
Suntower

Posts: 225
Posted: 03/25/2005, 8:56 AM

Is it possible to make a -real- input button from a form open the href in a separate window? I know this can be done in an <a> but I'd like to do this from a button.

I tried adding the js I would normally use to a the button_update_on_click event for a button but it doesn't seem to do anything.

Your thoughts?

TIA,

---JC
_________________
---On a campaign for more examples and better docs!
View profile  Send private message
Nicole

Posts: 586
Posted: 03/28/2005, 1:04 AM

Suntower,
First of all check if button’s client side onClick event is fired. Just add alert() to verify it. If event work, then you can use the following Javascript code to open a new pop up window
var w = open ('', 'windowName', 'width=200,height=500,titlebar=1');
w.document.open();
w.location.href="may page address/name";
w.document.write('<HTML><BODY>Please wait while page is loading...<br><A HREF="javascript: window.close();">close<\/A>');
w.document.close();

Refer to MSDN article for more information about open method of window object
http://msdn.microsoft.com/workshop/author/dhtml/referen...hods/open_0.asp

_________________
Regards,
Nicole
View profile  Send private message
Suntower

Posts: 225
Posted: 03/28/2005, 10:06 AM

OK, got it. My mistake was thinking that I needed to create a function in the header and then call that function in the body. This is much easier.

Next problem: How do I pass values from ASP into the JS code? Specifically:

I have a page with 3 listboxes on a form and a submit button. Each of the list boxes selects a different parameter. When the user hits the submit button, it calls the proper page with the 3 parameters. It works FINE using the server-side ASP.

However, I would -prefer- to have the new page open in it's own window rather than overwriting the caller page.

Your example shows me how to call the page I need in a new window: GOOD! Now... How do I pass the value of the 3 list boxes to the child window (or rather how do I append these values to the filename in Window.Open()?

TIA,

---JC




Quote Nicole:
Suntower,
First of all check if button’s client side onClick event is fired. Just add alert() to verify it. If event work, then you can use the following Javascript code to open a new pop up window
var w = open ('', 'windowName', 'width=200,height=500,titlebar=1');
w.document.open();
w.location.href="may page address/name";
w.document.write('<HTML><BODY>Please wait while page is loading...<br><A HREF="javascript: window.close();">close<\/A>');
w.document.close();

Refer to MSDN article for more information about open method of window object
http://msdn.microsoft.com/workshop/author/dhtml/referen...hods/open_0.asp


_________________
---On a campaign for more examples and better docs!
View profile  Send private message
Nicole

Posts: 586
Posted: 03/29/2005, 1:24 AM

You can pass listboxes values to a pop up page via URL, like
w.location.href="PageName.asp?LB1="+ document.form_name.listbox1_name.value + "&LB2=" + document.form_name.listbox2_name.value;
Also CCS Example Pack 1 includes the similar example, check Pop Up list sample at
http://examples.codecharge.com/ExamplePack/PopUpList/PopUpList.php

_________________
Regards,
Nicole
View profile  Send private message
Suntower

Posts: 225
Posted: 03/29/2005, 9:19 AM

Thanks. One last thing...

Can one also grab the request parameters from the page in JS?

IOW: The page with the button is something like:

Reports_Menu.ASP?Module=123456

I need to be able to concatenate "Module=123456" onto the end of the href for the button so that it ends up being...

w.location.href="Reports_Called.asp?Module1=123456?Selection1=" + document.form1.selectbox1.value;

Is there a JS function for this?

Thanks Again!

----JC




Quote Nicole:
You can pass listboxes values to a pop up page via URL, like
w.location.href="PageName.asp?LB1="+ document.form_name.listbox1_name.value + "&LB2=" + document.form_name.listbox2_name.value;
Also CCS Example Pack 1 includes the similar example, check Pop Up list sample at
http://examples.codecharge.com/ExamplePack/PopUpList/PopUpList.php


_________________
---On a campaign for more examples and better docs!
View profile  Send private message
Nicole

Posts: 586
Posted: 03/30/2005, 12:52 AM

Suntower,
It is possible, but requires some custom coding again.
window.location.search returns string of all URL parameters, i.e. full string after question mark.
You need to use string JavaScript specific functions to parse the string and get a value you need. Search on web for ready to use solutions/functions.

_________________
Regards,
Nicole
View profile  Send private message

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.