Click to See Complete Forum and Search --> : Javascript popwindow with a form...
T0MMY
Mar 28th, 2002, 12:01 PM
Hi i have a poll i made in php and using a javascript popup window from a snippet i got from the web but ever since i used the javascript when the user clicks the vote button the values arent sent so the vote dosent count.
heres the script im using in the form...
<FORM NAME="VotePoll" ACTION="javascript:;" onSubmit="OpenBrWindow('../poll.php','Test2','toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=yes','240', '300','true')" METHOD=POST>
thanks
mendhak
Mar 28th, 2002, 12:36 PM
ACTION="Javascript:;" is your problem...
If poll.php is the page where the votes get registered, then you're going to have to pass along the information from THIS page to that one. then ONLY can his vote get registered.
scoutt
Mar 28th, 2002, 12:36 PM
well in poll.php you will need to run some more javascript to get the form values to it.
something like
<html>
<head>
<title>Untitled</title>
<script language=javascript>
Function set_form_data(){
var parent=window.opener.form1.textbox1.value;
window.document.form2.textbox2.value=parent;
}
</script>
</head>
<body onload="set_form_data();">
<form Name="form2">
<Input Type="test" Name="textbox2" size=15 disabled>
</form>
</body>
</html>
T0MMY
Mar 28th, 2002, 12:53 PM
Thanks guys isnt there any way i could get the info before opening the window and then adding to the link the values so it would then look a little somthing like this.....
"OpenBrWindow('../poll.php?checked=1',....etc
then that would make it alot easier to work with in PHP
scoutt
Mar 28th, 2002, 12:59 PM
but not if you have to open a new window. the new window has to talk to the window that opened it. so the child window has to tak to the mother window so it knows what variables it needs.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.