Results 1 to 5 of 5

Thread: Javascript popwindow with a form...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    UK - Liverpool
    Posts
    113

    Question Javascript popwindow with a form...

    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
    My software never has bugs. It just develops random features...

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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.

  3. #3
    scoutt
    Guest
    well in poll.php you will need to run some more javascript to get the form values to it.

    something like

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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    UK - Liverpool
    Posts
    113
    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
    My software never has bugs. It just develops random features...

  5. #5
    scoutt
    Guest
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width