...

View Full Version : Processing form in new window onclick



dhtmlhelp
06-30-2002, 05:47 PM
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

eak
06-30-2002, 06:07 PM
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.



<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>

boxer_1
06-30-2002, 07:57 PM
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 $(:-|

glenngv
07-01-2002, 08:25 AM
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');

eak
07-01-2002, 08:13 PM
i found a better way to do it. this is the code from my site.



<form name="NewWindowGenerator" action="newwindowcode.php" method="get" onsubmit="NewWindow('','generatedCode',650,500,'resizable,scrollbars','center');" target="generatedCode">

other stuff here

</form>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum