SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Window size

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    Peterborough, England
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which part of the HTML determines the size of the window when a new window is load in the following HTML?

    <HTML>
    <HEAD>
    <TITLE>Wood Login</TITLE>

    <SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from tired old browsers that should be put to pasture.


    function goForit() {
    var location;
    var password;
    password=this.document.testform.inputbox.value
    location=password + ".html"
    fetch(location)
    theKeeper=window.close()
    }

    function fetch(location) {
    var root;
    if (opener.closed) {
    root=window.open('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
    root.location.href = location;
    } else {
    opener.location.href = location;
    }
    }

    // End hiding --->
    </SCRIPT>

    </HEAD>

    <BODY BACKGROUND="backgroundWCC2.jpg">

    <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
    <TR>
    <TD ROWSPAN=2 WIDTH=50%>
    <img border="0" src="../JPEG%20images/Wogo.jpg">
    &nbsp;&nbsp;

    <TD WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE>
    <FONT FACE="ARIAL" SIZE=2><B>Please enter the password you have been issued with and the click on the "Submit Password" button below.</B></FONT><BR>
    &nbsp;

    <TR>
    <TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM>
    <CENTER>
    <FORM NAME="testform">
    <INPUT TYPE="text" NAME="inputbox" VALUE="" size=20>
    <INPUT TYPE="submit" NAME="button" Value="Submit Password" onClick="goForit(this.form)">





    </FORM>
    </CENTER>


    </TABLE>

    </BODY>

    </HTML>



    Also, if someone could test this HTML, at the moment people have to type the password and then click on submit password. How could i make it so they only need to hit return? Can you please try out ideas please, because i have had one or two ideas, but they haven't worked,

    thanks,

    internationally

  2. #2
    SitePoint Member
    Join Date
    Sep 2000
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    about the window size, using some pop windows you can control the hieght and with by modiffying the hieght and width properties in your window.open(...) call

    you have:
    if (opener.closed) {
    root=window.open('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
    root.location.href = location;
    } else {
    opener.location.href = location;
    }
    and all you need to do is add the following two properies and you will have a window opened to the size you desire:

    width='x' hight='y'

    in here:
    ('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no',width='x',hight='y')

    where x and y are your hieght and width in pixels.

    I will check on the pressing enter for submitting, to my knowledge IE does this by default. But NS seems want press of the button, you can do a key press detection by having the browser detect a keystrok and then with that keystrok the submit be done. I have to loo up the script for that, as that I do not have it on hand right now. I have not tested out the HTML, but I will when I get another chance.


Bookmarks

Posting Permissions

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