Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 8 1 2 3 ... LastLast
Results 1 to 10 of 71
  1. #1
    Senior Member
    Join Date
    Mar 2003
    Location
    Hegelsom, The Netherlands
    Posts
    104
    Member #
    834
    @Filburt: Sorry for emailing you I guessed my email and it was correct :classic:

    @javascriptgeeks: Ok i need help.

    I'm into PHP now and I built a Poll system. Not very hard. But i want it to display the results (if clicked on Results button) or vote and show results after (if you selected an option and voted) in a popup screen.
    The problem is I can't seem to get the vars passed on in the popup so that i can further check/modify them as i wanto. Anybody got some ideas? (i searched the web for this for almost 3 hours and i still haven't found a good explanation) *gulp* :cheeky:
    Guess who's back! It's me! Tim 2K

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    735
    Member #
    1935
    you need to name the window..
    umm geez, its been ages but i did do it on a site a while ago..
    take advantage of the onSubmit event.

    ahhh, if you go to CNN.com and use their poll then it should open up a new window. so check out their sourcecode...

  4. #3
    Senior Member
    Join Date
    Mar 2003
    Location
    Hegelsom, The Netherlands
    Posts
    104
    Member #
    834
    Hmm i tried viewing Gamespot's as well but that didn't work. Anybody else? (i'll try CNN in a min)
    Guess who's back! It's me! Tim 2K

  5. #4
    Senior Member
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    735
    Member #
    1935
    ok,
    what youve gotta do is add a target="windowname" to your form.

    <form name="main" target="windowname" method="post" acton="page.php">

    then, in the submit button you have to call a window.open function.

    <input type="submit" onClick="OpenWin('','windowname','toolbar=no,locat ion=no,directories=no,status=no,menubar=no,scrollb ars=no,resizable=no,width=200,height=200')" value="submit vote" name="vote">

    that should work..

  6. #5
    Senior Member
    Join Date
    Mar 2003
    Location
    Hegelsom, The Netherlands
    Posts
    104
    Member #
    834
    That worked!! Never knew it was so simple :S Thanks a lot! :classic:
    Guess who's back! It's me! Tim 2K

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    i think you can actually open the window in the "onsubmit" event of the form.

  8. #7
    Senior Member
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    735
    Member #
    1935
    yer, i think it should work either way..
    thats ok. i remember doing it a while back in a site i was creating.

  9. #8
    Senior Member
    Join Date
    Mar 2003
    Location
    Hegelsom, The Netherlands
    Posts
    104
    Member #
    834
    Hmm, it doesn't popup. It DOES send the form vars. This is what i have:
    <script language="javascript" type="text/javascript">
    <!--
    function pollpopup() {
    window.open('', 'Pollwindow','toolbar=no,location=no,directories=n o,status=no,menubar=no,scrollbars=yes,resizable=no ,width=400,height=400);
    }
    --!>
    </script>

    And then my form:

    <form name="form" target="Pollwindow" method="post" action="./polls.php">
    $voterows /* PHP: The Checkboxes will appear where along with the available answers */
    <input type="image" src="./images/poll/3_vote.gif" width="51" height="28" border="0" value="Vote" onSubmit="pollpopup()">
    <input type="image" value="Results" src="./images/poll/3_results.gif" width="52" height="28" border="0" onSubmit="pollpopup()">
    Guess who's back! It's me! Tim 2K

  10. #9
    Senior Member
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    735
    Member #
    1935
    two things:

    1. you havent got the finishing single quote ( ' ) at the end of your function.

    2. put the "onSubmit" inside the <form> tag instead of the <input> tag..

    just fix those things up and it should work. if it doesnt then make sure you post again.

  11. #10
    Senior Member
    Join Date
    Mar 2003
    Location
    Hegelsom, The Netherlands
    Posts
    104
    Member #
    834
    Nope *snif*
    This is what i have:
    BTW The script is not in the head.

    <script language="javascript" type="text/javascript">
    <!--
    function pollpopup() {
    window.open('', 'Pollwindow','toolbar=no,location=no,directories=n o,status=no,menubar=no,scrollbars=yes,resizable=no ,width=400,height=400');
    }
    --!>
    </script>

    <form name="form" target="Pollwindow" method="post" action="./polls.php" onSubmit="pollpopup()">

    <input name="pollid" type="hidden" value="$pollid"><input type="image" src="./images/poll/3_vote.gif" width="51" height="28" border="0" value="Vote">

    <input type="image" value="Results" src="./images/poll/3_results.gif" width="52" height="28" border="0">
    Guess who's back! It's me! Tim 2K


Page 1 of 8 1 2 3 ... LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:48 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com