Form question

Discussion in 'HTML' started by Cogito, Sep 4, 2003.

  1. Cogito

    Cogito Guest

    The following form (which I copied from somewhere) consists of one
    button only:

    <form>
    <input type=button value="Solution" style="background-color: d7dcc5"
    onClick="window . open ('solution.html', '',
    'width=300,height=450');">
    </form>

    My questions are:
    1. How do I set the font size and color?
    2. The pop-up window appears at the top left corner of the screen. Is
    it possible to set a different location?
     
    Cogito, Sep 4, 2003
    #1
    1. Advertising

  2. Cogito wrote:

    > The following form (which I copied from somewhere) consists of one
    > button only:
    >
    > <form>
    > <input type=button value="Solution" style="background-color: d7dcc5"
    > onClick="window . open ('solution.html', '',
    > 'width=300,height=450');">
    > </form>


    A very nasty, inaccessible way of doing:

    <a href="solution.html"
    onclick="if(window.open){window.open(this.href,'myWindow',width=300,height=450');return
    false;}else{return true;}">Solution</a>

    The code you provided also happens to have a number of syntax errors.

    > My questions are:
    > 1. How do I set the font size and color?


    Same as any other element:
    http://www.w3.org/TR/CSS2/fonts.html#font-size-props
    http://www.w3.org/TR/CSS2/colors.html#colors

    > 2. The pop-up window appears at the top left corner of the screen. Is
    > it possible to set a different location?


    In ordef or preference:

    (1) Don't use a popup window
    (2) Don't use a popup window (Yes, I know I put this one twice. It is a VERY
    good solution to the problem)
    (3) Get a better windowing system that places the window somewhere you're
    happier with
    (4) Muck about with the "moveto()" function in the onload event of the
    document you are loading in to the new window.

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Sep 4, 2003
    #2
    1. Advertising

  3. Cogito wrote:
    > The following form (which I copied from somewhere) consists of one
    > button only:
    >
    > <form>
    > <input type=button value="Solution" style="background-color: d7dcc5"
    > onClick="window . open ('solution.html', '',
    > 'width=300,height=450');">
    > </form>
    >
    > My questions are:
    > 1. How do I set the font size and color?
    > 2. The pop-up window appears at the top left corner of the screen. Is
    > it possible to set a different location?


    Funny... in the last couple days we've had a lot of really newbie form
    styling questions. Is this some school assignment, and the teacher sent
    you here for a free helpdesk, or is it just coincidence?


    Matthias
     
    Matthias Gutfeldt, Sep 4, 2003
    #3
  4. Cogito

    Cogito Guest

    On Thu, 04 Sep 2003 07:33:09 +0100, David Dorward <>
    wrote:

    >Cogito wrote:
    >
    >> The following form (which I copied from somewhere) consists of one
    >> button only:
    >>
    >> <form>
    >> <input type=button value="Solution" style="background-color: d7dcc5"
    >> onClick="window . open ('solution.html', '',
    >> 'width=300,height=450');">
    >> </form>

    >
    >A very nasty, inaccessible way of doing:
    >
    ><a href="solution.html"
    >onclick="if(window.open){window.open(this.href,'myWindow',width=300,height=450');return
    >false;}else{return true;}">Solution</a>
    >
    >The code you provided also happens to have a number of syntax errors.
    >
    >> My questions are:
    >> 1. How do I set the font size and color?

    >
    >Same as any other element:
    >http://www.w3.org/TR/CSS2/fonts.html#font-size-props
    >http://www.w3.org/TR/CSS2/colors.html#colors
    >
    >> 2. The pop-up window appears at the top left corner of the screen. Is
    >> it possible to set a different location?

    >
    >In ordef or preference:
    >
    >(1) Don't use a popup window
    >(2) Don't use a popup window (Yes, I know I put this one twice. It is a VERY
    >good solution to the problem)
    >(3) Get a better windowing system that places the window somewhere you're
    >happier with
    >(4) Muck about with the "moveto()" function in the onload event of the
    >document you are loading in to the new window.


    Thanks for your reply.
    I'm always eager to learn new and better ways of coding.
    When I incorporate your code sample it create a simple hyperlink to
    the solution page… nothing fancy despite the apparent 'complexity' of
    the code. Was it meant to create a pop-up or not? It seems as though
    the 'onclick' code does not do much..
     
    Cogito, Sep 4, 2003
    #4
  5. Cogito wrote:

    >><a href="solution.html"
    >>onclick="if(window.open){window.open(this.href,'myWindow',width=300,height=450');return
    >>false;}else{return true;}">Solution</a>


    > When I incorporate your code sample it create a simple hyperlink to
    > the solution page… nothing fancy despite the apparent 'complexity' of
    > the code. Was it meant to create a pop-up or not? It seems as though
    > the 'onclick' code does not do much..


    I missed off a "'" immediately before 'width', add it and it creates an
    annoying popup.

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Sep 4, 2003
    #5
  6. Cogito

    Cogito Guest

    On Thu, 04 Sep 2003 11:59:41 +0100, David Dorward <>
    wrote:

    >Cogito wrote:
    >
    >>><a href="solution.html"
    >>>onclick="if(window.open){window.open(this.href,'myWindow',width=300,height=450');return
    >>>false;}else{return true;}">Solution</a>

    >
    >
    >I missed off a "'" immediately before 'width', add it and it creates an
    >annoying popup.


    But it still does not pop.
     
    Cogito, Sep 4, 2003
    #6
  7. Cogito wrote:

    > But it still does not pop.


    It does here, what's your URI?

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Sep 4, 2003
    #7
  8. Cogito

    Cogito Guest

    ok, a new window now pops-up AND the main window changes as well.
     
    Cogito, Sep 4, 2003
    #8
  9. Cogito wrote:

    > ok, a new window now pops-up AND the main window changes as well.


    Not here. That's what all the return false stuff is about.

    URI?

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Sep 4, 2003
    #9
  10. Cogito

    Cogito Guest

    >> ok, a new window now pops-up AND the main window changes as well.
    >
    >Not here. That's what all the return false stuff is about.


    The moment you said, "That's what all the return false stuff is
    about." I figured it out.
    In your first reply the word "return" was at the end of the line and
    the word "false" was in a new line immediately following it without a
    space in between. Now that I have added the space it works fine.

    Thanks for showing me how to do it. (What was wrong with my old code?
    it worked well too.).
    Now I feel guilty about using pop-ups and will probably not use it…

    >
    >URI?


    It's not online yet. Just playing with it on my machine.
     
    Cogito, Sep 4, 2003
    #10
  11. Cogito wrote:

    > What was wrong with my old code?


    It was invisible to search engines and users of browsers without JavaScript.

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Sep 4, 2003
    #11
  12. Cogito

    Cogito Guest

    On Thu, 04 Sep 2003 15:06:13 +0100, David Dorward <>
    wrote:

    >Cogito wrote:
    >
    >> What was wrong with my old code?

    >
    >It was invisible to search engines and users of browsers without JavaScript.


    Oh, I thought everyone has Javascript. What language is the new code
    in?
     
    Cogito, Sep 4, 2003
    #12
  13. Cogito

    Chris Morris Guest

    Cogito <> writes:
    > On Thu, 04 Sep 2003 15:06:13 +0100, David Dorward <>
    > wrote:
    > >Cogito wrote:
    > >> What was wrong with my old code?

    > >
    > >It was invisible to search engines and users of browsers without JavaScript.

    >
    > Oh, I thought everyone has Javascript.


    No search engines have it, no text-based browser has it (though elinks
    are working on it, I believe), every browser with it has an option to
    disable it (though it's well-hidden in Internet Explorer), some
    firewalls/proxies strip it out for security reasons.

    > What language is the new code in?


    Javascript still, but this time with a HTML alternative that gets used
    if Javascript is disabled or unavailable.

    Now all you have to do is think of an alternative for users with
    Javascript enabled, but pop-ups disabled (in a broad as opposed to
    non-requested suppression, which is the only option in a lot of
    browsers/3rd party apps).

    --
    Chris
     
    Chris Morris, Sep 4, 2003
    #13
  14. Toby A Inkster, Sep 4, 2003
    #14
  15. Cogito

    Chris Morris Guest

    Toby A Inkster <> writes:
    > Chris Morris wrote:
    > > no text-based browser has [Javascript]

    >
    > Actually Links 2 has Javascript support.
    >
    > http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/features.html


    I knew it (and CSS support) were on their todo list. I've not been
    keeping up, obviously. Right, that's another new browser for my
    collection :)

    --
    Chris
     
    Chris Morris, Sep 5, 2003
    #15
  16. Chris Morris wrote:

    > I knew it (and CSS support) were on their todo list. I've not been
    > keeping up, obviously. Right, that's another new browser for my
    > collection :)


    Links makes a great browser for a cheap web browser kiosk. Take Linux, add
    in a 1024x760 or 800x600 framebuffer console, GPM (mouse driver), and Links
    and you have a mouse driven, graphical browser. I haven't tested it, but it
    would probably run comfortably on something as low powered as a 386. (No
    need for X at all). You could probably cram the entire system in to about
    6MB and run it from compact flash.

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Sep 5, 2003
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dbuchanan
    Replies:
    2
    Views:
    2,617
    dbuchanan
    Dec 19, 2005
  2. Li Zhang
    Replies:
    4
    Views:
    6,096
    softip
    Feb 27, 2009
  3. Replies:
    1
    Views:
    418
    Bryce
    Feb 25, 2005
  4. Rob R. Ainscough
    Replies:
    3
    Views:
    341
    Rob R. Ainscough
    Jun 14, 2005
  5. rob c
    Replies:
    4
    Views:
    338
    McKirahan
    Dec 30, 2005
Loading...

Share This Page