Go Back   CodingForums.com > :: Client side development > HTML & CSS

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 06-30-2002, 05:47 PM   PM User | #1
dhtmlhelp
Regular Coder

 
Join Date: Jun 2002
Location: London, UK
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
dhtmlhelp is an unknown quantity at this point
Processing form in new window onclick

Hi,

I am still having problems with this form. The revised code is below. The problems are:

- the pop up window where the asp is processed opens but does not respect the size defined. The js that defines the pop up window is:

function NewWindow(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

- when cursor is in text area and I press enter the onclick event is ignored and the asp page is loaded in the main window.

Below is the script I am using for the form.


<form method="post" name="frmEnquiry" action="asp/ezine.asp" onSubmit="return FormValidator(this)">
<input type="text" name="email" size="20" value=" ... Your Email ..." onFocus="if(this.value==' ... Your Email ...')this.value='';" class="box3" onMouseOver="this.className='box3b'" onMouseOut="this.className='box3'" onClick="this.className='box3b'"><input type="submit" name="submit" OnClick="NewWindow('asp/ezine.asp','680','390','yes');return false;" value=" >> ISCRIVITI! " class="testo" style="color: #F4F4F4;border-color: #3163B7;border-width=2;background-color: #356CC8;width:120;height:17;font-family:Verdana;font-size:7pt;font-color:#000000">
</form>

Can someone spot what how to solve the 2 problems above.

DHTMLHELP
dhtmlhelp is offline   Reply With Quote
Old 06-30-2002, 06:07 PM   PM User | #2
eak
Regular Coder

 
eak's Avatar
 
Join Date: Jun 2002
Location: Nashville, TN
Posts: 354
Thanks: 0
Thanked 26 Times in 26 Posts
eak is on a distinguished road
i made the NewWindow function that your using. the one you have is really old. you should go to my site and generate a new copy(url in sig).

try this code. its the same method i use on my site to popup submited form data in a window.

Code:
<form name="yourform" action="yourpage.asp" target="code">

<input type="submit" value="submit" onclick="
NewWindow('','code',650,500,'resizable,scrollbars',
'center');document.forms.yourform.submit();return false;" />
</form>
__________________
eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."

Last edited by eak; 06-30-2002 at 06:12 PM..
eak is offline   Reply With Quote
Old 06-30-2002, 07:57 PM   PM User | #3
boxer_1
Regular Coder

 
Join Date: May 2002
Location: Maine, USA
Posts: 574
Thanks: 0
Thanked 0 Times in 0 Posts
boxer_1 is an unknown quantity at this point
dhtmlhelp,

Just curious, but where did your original thread go with an ongoing discussion about this problem? IMHO it would have been better to continue the discussion in that thread as opposed to deleting it and starting a new thread on (essentially) the same problem.

It would have been easier for everyone to follow along by seeing waht had been done thus far, you had quite a few replies there that might have contained some useful information to others trying to help you with this problem.

Also, when a question is asked and a there are suggestions and / or solutions added to the thread, it is quite useful to leave the thread in place. This way, if someone comes along with a similar problem and searches the forum your thread may turn up in their search results and contain a sugesstion or 2 that might help them with their problem . Just my 2 cents worth $(:-|
__________________
boxer_1
CodingForums Moderator
"How did a fool and his money get together in the first place?"
boxer_1 is offline   Reply With Quote
Old 07-01-2002, 08:25 AM   PM User | #4
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Re: Processing form in new window onclick

your function is this:

function NewWindow(mypage, myname, w, h) {


but you call it like this:

OnClick="NewWindow('asp/ezine.asp','680','390','yes');


maybe you want it like this:

OnClick="NewWindow('asp/ezine.asp','yes','680','390');
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 07-01-2002, 08:13 PM   PM User | #5
eak
Regular Coder

 
eak's Avatar
 
Join Date: Jun 2002
Location: Nashville, TN
Posts: 354
Thanks: 0
Thanked 26 Times in 26 Posts
eak is on a distinguished road
i found a better way to do it. this is the code from my site.
Code:
<form name="NewWindowGenerator" action="newwindowcode.php" method="get" onsubmit="NewWindow('','generatedCode',650,500,'resizable,scrollbars','center');" target="generatedCode">

other stuff  here

</form>
__________________
eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."
eak 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 04:24 AM.


Advertisement
Log in to turn off these ads.