SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    New Jersey
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Setting the size of a browser window

    I hope someone can advise me on the best way to do what I need to do for this project I am working on.

    I have your basic user interface tied to a MySQL db that has multiple pages. One of them is a search form that consists of 5 selection fields with 3 buttons. I would like to know how I can set and control the size a browser window will open to when this form is accessed.

    A second thought is, how can I have this form automatically open in a new browser window when the main page is accessed?

    Any help or suggestions would be very much appreciated.

    Thanks in advance for your help.
    If you keep doing what you did,
    you will keep getting what you got..

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    European Union
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EzPc,

    you can apply the size of a browser window by adding the following javascript event in the form tag:

    Code:
    <form  action="file.php" method="post" target="yournewwindow" 
    onSubmit="window.open('', 'yournewwindow', 'width=450, height=300, 
    status=yes, resizable=yes, scrollbars=yes')">
    Please pay attention to the name of the new window. It have to be the same in the form tag target and in the javascript code.

    Your second thought - the pop up: You shouldn't do that. If you have to, take the onSubmit event and change it to an onLoad event and put it in the body tag. That should work.

    Greetings

    NN
    Last edited by NameNick; Sep 28, 2002 at 15:54.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    New Jersey
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    Thanks NameNick for your suggestion.. I will give it a try. I have not gotten into Java-scripts yet.. can you suggest a good starting point??
    If you keep doing what you did,
    you will keep getting what you got..

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    European Union
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EzPc,

    You should get you a JavaScript tutorial and take a look at the functions and possibilities of JavaScript. If you know what can be made with JS, you will have an imagination how a task/job can be done or a problem can be solved. Take a real project to learn on it. A pure theoretical exercise could be too abstract, not enough practice and reality in it - in my opinion.

    Greetings

    NN

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    New Jersey
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    Thank you for your insite. I do have several projects I am currently using to learn PHP. I thought that I could acomplish most of what I am trying to do with PHP but as you have said, there appears to be just a much you can do with JS...
    If you keep doing what you did,
    you will keep getting what you got..

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    European Union
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    The PHP or JavaScript thing. My priority is PHP first, and if there anything left that cannot be done by using PHP, it might be done with JS.

    Greetings

    NN

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    New Jersey
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    I am of the same mindset.. just still learning what I can get done with PHP.. Thanks again for your help.
    If you keep doing what you did,
    you will keep getting what you got..


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
  •