PDA

View Full Version : little chi help please?



Weapon
April 8th, 2001, 18:22
well the other day I recieved an email from one of those stupid win on the web thing, having nothing to do I went to there site. On their site you had to fill out a form. like all others to be in the draw, but what I really want to know is that instead of having a submit button you have to click on a banner to submit the form and upon clicking it pops up another window with "thank you for entering our draw" and in the original window it goes to the advertiser's page, so I was wondering how are you suppose to do that?

Canuckkev
April 8th, 2001, 18:56
Uhh...easy. Use some JS to pop the window with a OnSubmit code in the <form> tag I believe. Then in the cgi script, just put: print "Location:URLhere\n\n"; .

Weapon
April 8th, 2001, 19:48
Originally posted by Canuckkev
Uhh...easy. Use some JS to pop the window with a OnSubmit code in the <form> tag I believe. Then in the cgi script, just put: print "Location:URLhere\n\n"; .
Can you explain more clearly what I do with the javascript one?

gyrbo
April 9th, 2001, 03:12
I think I know it. If you click the button, then it loads a script in a new window, but with javascript, it reads all the content of then form and adds it to the URL.

Weapon
April 9th, 2001, 04:57
not saying its bad or anything but do you like answering my post? any can you explain it anyways?

Canuckkev
April 9th, 2001, 19:54
A couple of ways...

<html>
<head>
<title>TITLE</title>
<script>
function pop(){

var file="popup.htm"

if (document.all)
popwindow=window.open(file,"","width=468,height=60")
else
popwindow=window.open(file,"","width=468,height=60,scrollbars")
}
</script>
</head>
<body>
<form action="scipt.cgi" method="POST" onSubmit="pop();">
Use the onsubmit to start the "pop" function...or
<input onClick="pop();" type="submit" value="Submit">
Put an onclick in the submit button
</form>

</body>
</html>