Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-14-2009, 04:43 PM   PM User | #1
keek2a4
New to the CF scene

 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
keek2a4 is an unknown quantity at this point
need some help to edit javascript function so the link opens in new window

I have the following html code, that is an input Button and onclick runs the javascript function EnquiriesReport().

Code:
<input type="Button" name="Enquiries" value=".Enquiries" onClick="EnquiriesReport()" class="formsubmitTwo">
Here is the javascript code for the EnquiriesReport() function:
Code:
function EnquiriesReport()
{
	if( ValidateData()) {
 	form1.action="EnquiriesReport.asp?"
	form1.submit();   
	}                           
}
My question is how can I run the EnquiriesReport() function so that the "EnquiriesReport.asp?" opens in a new window?

Can someone please point me in the right direction.

Thanks,
Ket
keek2a4 is offline   Reply With Quote
Old 05-14-2009, 05:08 PM   PM User | #2
ShadowIce
Regular Coder

 
Join Date: Apr 2009
Posts: 264
Thanks: 24
Thanked 1 Time in 1 Post
ShadowIce can only hope to improve
Quote:
Originally Posted by keek2a4 View Post
I have the following html code, that is an input Button and onclick runs the javascript function EnquiriesReport().

Code:
<input type="Button" name="Enquiries" value=".Enquiries" onClick="EnquiriesReport()" class="formsubmitTwo">
Here is the javascript code for the EnquiriesReport() function:
Code:
function EnquiriesReport()
{
	if( ValidateData()) {
 	form1.action="EnquiriesReport.asp?"
	form1.submit();   
	}                           
}
My question is how can I run the EnquiriesReport() function so that the "EnquiriesReport.asp?" opens in a new window?

Can someone please point me in the right direction.

Thanks,
Ket
Scuse me if Im wrong, but try something like this.

This doesnt work fully, but u should understand now

Code:
<form name="form1">

<input type="Button" name="Enquiries" value=".Enquiries" onClick="EnquiriesReport()" class="formsubmitTwo">

</form>

<script>
function EnquiriesReport()
{
	if( ValidateData()) {
 	form1.action=newwin('EnquiriesReport.asp?','Enquiries Report','400,300');
	form1.submit();   
	}                           
}

function newwin(url,title,width,height){

	newwindow=window.open(url,title,'width='+width+',height='+height+');
	if (window.focus) {newwindow.focus()}
	return false;

}
</script>
Good Luck!

~ShadowIce~
ShadowIce is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:04 PM.


Advertisement
Log in to turn off these ads.