31 users online (0 members and 31 guests)  


  Results 1 to 3 of 3

Related

  1. Passing value from parent window to child window    Forum: Javascript Forum
    Replies: 0
  2. help positioning    Forum: HTML Forum
    Replies: 4
  3. Replies: 1
  4. positioning a popup window    Forum: HTML Forum
    Replies: 1
  1. #1
    minds_gifts's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2003
    Posts
    15

    Positioning the window

    Hello everybody,

    I display records on a page from a table using PHP and theres a link called "Contact the person"When i click on this link, i want to open a new page and this page has to be centered on the window.This code is working fine in another application of mine but does'nt seem to work here.Could somebody please tell me why this does'nt work.

    Thanks in advance

    On the first page i've this code:
    Code:
    echo"<tr>";
    echo"<td width='50%'><a href='contactform.html' target='_blank'>Contact the Person</a>";
    echo"</tr>";
    and now when i click on contact the person, the page contactform.html opens and here is the code for that.

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Contact Page</title>
    
    <script type="text/javascript">
    
    function openWindow(theURL,winName,features, myWidth, myHeight, isCenter) { 
      if(window.screen)if(isCenter)if(isCenter=="true"){ 
        var myLeft = (screen.width-myWidth)/2; 
        var myTop = (screen.height-myHeight)/2; 
        features+=(features!='')?',':''; 
        features+=',left='+myLeft+',top='+myTop; 
      } 
      window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight); 
    } 
    
    </script>
    </head>
    
    <body bgcolor="#FFFFCC">
    
    <table border="1" width="100%">
      <tr>
        <td width="50%">Your name</td>
        <td width="50%">
          <p><input type="text" name="T1" size="20"></p>
          </td>
      </tr>
      <tr>
        <td width="50%">Your text</td>
        <td width="50%"><input type="text" name="T2" size="20"></td>
      </tr>
      <tr>
        <td width="50%">Your description</td>
        <td width="50%">
          <p><textarea rows="2" name="S1" cols="20"></textarea></p>
          
        </td>
      </tr>
    </table>
    
    <table border="1" width="100%">
      <tr>
        <td width="100%"><input type="submit" name="submit" value="enter"></td>
      </tr>
    </table>
    
    </body>
    
    </html>

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Is it me, or is the JavaScript code for the popup on the wrong page?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    minds_gifts's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2003
    Posts
    15
    yeah, java-script is placed in the wrong page.I ifxed it.



Tags for this Thread