Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with popup window

    Hi All

    I am trying to pass some values through a URL to a popup window .....



    <Script Language="JavaScript">
    <!--
    function load(code,leader,passcode,area,value,pid) {

    var url = 'change.php?id='+code+'&leader='+leader+'&passcode='+passcode+'&val='+value+'&area='+area+'&pid='+pi d;

    var load = window.open(url ,"change","scrollbars=no,menubar=no,height=100,width=400,resizable=yes,toolbar=no,location=no,status =no");

    }
    // -->
    </Script>

    I am assigning the proper values to the variables and a popup window is opening when I click on the hyperlink.

    <td class=prompt nowrap><a class=lnk href=# onclick=\"

    load('".$t."','".$leader."','".$passcode."','".$area."','".$values[$z+1]."','".$pid."');\">".$labels[$z+1]."</a></td>


    The problem is ariasing when I am trying to perform the following things in change.php(here is where I write the code for the popup window)
    <head>
    <script Language=Javascript>
    function ReloadParent() {
    window.opener.document.location.reload();
    }
    </script>
    </head>

    <body bgcolor="#FFFFFF" onUnload='ReloadParent();'>


    if ($_GET['id'] && $_GET['leader'] && $_GET['passcode'] && $_GET['val'] && $_GET['area'] && $_GET['pid']) {

    <form method=post action=change.php>
    .
    .
    some code
    .
    .
    </form>

    }else

    if ($_POST['area'] && $_POST['oldv'] && $_POST['pid'] && $_POST['id'] && $_POST['leader'] && $_POST['passcode'] && $_POST['nval']) {


    }

    else

    {
    <tr><td align=center class=prompt>No username,password, or level was entered.</td></tr>

    }

    At times it is executing correctly and at other times The control of the program is going to last else clause and its displaying that "No username,password, or level

    was entered" eventhough I have supplied them..................

    I am been trying to solve this problem from quite a few days and I am posting this as a last resort ............Please help.

    Thanks
    Huskers

  • #2
    New Coder
    Join Date
    Oct 2005
    Posts
    87
    Thanks
    1
    Thanked 0 Times in 0 Posts
    If you could post your entire script, I will test it and post any errors I find. It's very difficult to say what the problem is without seeing the whole script. I do have one suggestion though. In php, it automatically interprets all of the variables contained between quotes. So instead of using quotes around each variable, just put the quotes at the beginning and end of the content that you want to print. Also, I would suggest placing the link function directly after the href= instead of using the onclick event handler.

    Code:
    echo "<td class=prompt nowrap><a class=lnk href=\"javascript:load('$t','$leader','$passcode','$area','$values[$z+1]','$pid');\">$labels[$z+1]</a></td>";

  • #3
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    Thanks for ur help ............
    My problem got solved ...


  •  

    Posting Permissions

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