Open a window.

N

n2K

Hello to all. I would like to open a new window (Function is called
NewWindow and is writtent in VBscript) when a user submits a form. All the
samples I found on the web indicate something like the following:

<%@ Language=VBScript %>
<html>
<head>
</head>
<body>

<script language="javascript">

function NewWindow()
NewWindow = window.open
("Slider.asp","progress","toolbar=no,scrollbars=no,width=200,height=150,menubar=no,location=no,resizable=no");
end function

</script>

<form enctype="multipart/form-data" action="SomeASPpage.asp" method="post"
name="main1" onsubmit = NewWindow()>
<input name="file" type="file" size="50">
<INPUT type="text" id=text1 name=text1><INPUT type="text" id=text2
name=text2>
<input name="submit" type="submit" value="Do It">
</form>
</body>
</html>

What am I doing wrong? I've even tried RETURN NEWWINDOW() after ONSUBMIT.
(Okay, it's probably not close - but I am new at this).

TX...
 
N

n2K

Quite right, it is client side. I'm not sure what you mean by form.submit()
in the Function's event? In addition, do I remove the SUBMIT button in my
form/

thanks
 
M

Mark Schupp

This is client-side and would be better asked on a client-side group. Here
are a few comments however:

First of all you have set language="javascript" in the script tags but you
are using vbscript (get in the habit of using javascript client-side if you
can).

Do you want the form to submit whether popup window succeeds or not? If so
return "true" from your NewWindow() function. You are currently returning
the window handle or the new window.

Does the form submit and processing work properly if you leave out the
"onsubmit=" attribute. If not what error do you get?
 
N

n2K

Good points about Javascript. Again, in the learning phasse, but I'm getting
there.

Yes, the form works correcly without the onsubmit. The idea here is that I'm
trying to determine the size of a file that I want to pass to the ASP script
that uses a COM HTTP (asptypelibrary) component. I utlimately want to
display a progress bar. However, with the AspTypeLib, you cannot access the
form object once you're instansiated the component. A little confusing as I
know COM, but not reall "Snuffy" about ASP etc.

But I do thank you for the pointers and assist.
 
N

n2K

Sorry Mark, I should be a little more explanative.

Want I want to do is to start my Progress Bar BEFORE I submit the form. So
my thunkin was that I could use the onsubmit to call a function. The
function determines the file size using filescripting, then starts my pbar
(my pbar needs the incriment value which I calculate from the file size),
THEN submit the form to my asp script.

Obvisouly, not there yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top