Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 5th, 2003, 09:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default javascript pop up from form

Hi there

this is not strictly an asp question but here goes anyway!

I've got a form processing script that needs to launch a pop up window. How do I incorporate a javascript function into the action of the form?

i.e this needs to sit in the action of the form....

<script language="javascript">
window.open("thanks_subs.asp", "_blank", "width=210,height=200");
history.go(-1);
</script>

This is the form code:

<form name="frm_pass_it_on_good" action="thanks_subs.asp" method="POST">

I guess thanks_subs.asp needs to be replaced withthe code but am not sure how to do this

Many thanks

Adam
 
Old June 5th, 2003, 10:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'm assuming that what you want is to post the form to a new window? (since your example code for window.open refers to the same page that the form posts to.)

If this is the case you can just add a target="_blank" attribute to the <form> tag.

In general, if you want to do some js before the form submits, you can either:
1. use the onsubmit event of the form
2. change the submit button to a regular html button which runs your js and then calls formname.submit()

hth
Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript error pop up cathiec Javascript 1 June 13th, 2006 10:07 AM
passing data to javascript pop up webnitro Javascript How-To 2 November 29th, 2005 10:38 AM
JavaScript open pop-up crmpicco Javascript How-To 1 June 10th, 2005 03:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.