HTML Form with a Select List and without Submit Button

Discussion in 'HTML' started by =?ISO-8859-15?Q?Martin_P=F6pping?=, Jun 17, 2006.

  1. Hi,

    somewhere I have seen that it is possible to create a formular
    with a select box and without any submit button.

    if you select via the select box an item, then the new page is loaded.

    how can i do that?


    bye,
    martin
     
    =?ISO-8859-15?Q?Martin_P=F6pping?=, Jun 17, 2006
    #1
    1. Advertising

  2. Martin Pöpping wrote:
    > Hi,
    >
    > somewhere I have seen that it is possible to create a formular
    > with a select box and without any submit button.
    >
    > if you select via the select box an item, then the new page is loaded.
    >
    > how can i do that?


    Requires JavaScript, you create a submit function that you must attach
    to the SELECT onchange event. You should provide and an alternate for
    folks who have JavaScript disabled.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 17, 2006
    #2
    1. Advertising

  3. Jonathan N. Little schrieb:
    > Martin Pöpping wrote:
    >> Hi,
    >>
    >> somewhere I have seen that it is possible to create a formular
    >> with a select box and without any submit button.
    >>
    >> if you select via the select box an item, then the new page is loaded.
    >>
    >> how can i do that?

    >
    > Requires JavaScript, you create a submit function that you must attach
    > to the SELECT onchange event. You should provide and an alternate for
    > folks who have JavaScript disabled.


    Thanks,

    I did it like this now:

    <form name="form_genlist" method="get" action="index.asp">
    <select name="genfile" OnChange ="document.form_genlist.submit()">
    //...

    but how to do the alternate without JS?


    Bye,
    Martin
     
    =?ISO-8859-15?Q?Martin_P=F6pping?=, Jun 17, 2006
    #3
  4. Martin Pöpping wrote:
    > Jonathan N. Little schrieb:
    >> Martin Pöpping wrote:
    >>> Hi,
    >>>
    >>> somewhere I have seen that it is possible to create a formular
    >>> with a select box and without any submit button.
    >>>
    >>> if you select via the select box an item, then the new page is loaded.
    >>>
    >>> how can i do that?

    >>
    >> Requires JavaScript, you create a submit function that you must attach
    >> to the SELECT onchange event. You should provide and an alternate for
    >> folks who have JavaScript disabled.

    >
    > Thanks,
    >
    > I did it like this now:
    >
    > <form name="form_genlist" method="get" action="index.asp">
    > <select name="genfile" OnChange ="document.form_genlist.submit()">
    > //...
    >
    > but how to do the alternate without JS?


    I would say the most simply with NOSCRIPT.

    <form name="form_genlist" method="get" action="index.asp">
    <select name="genfile" OnChange ="document.form_genlist.submit()">
    <noscript><input type="submit" value="go"></noscript>
    ....

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 17, 2006
    #4
  5. Martin Pöpping <> scripsit:

    > somewhere I have seen that it is possible to create a formular
    > with a select box and without any submit button.
    >
    > if you select via the select box an item, then the new page is loaded.


    It's still a wrong way of doing things, even if you use <noscript> with
    meaningful content. Doing navigation that way is a very poor surrogate for
    links, for about a dozen reasons, see
    http://www.cs.tut.fi/~jkorpela/forms/navmenu.html#ben

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jun 17, 2006
    #5
  6. Martin Pöpping wrote:
    > Hi,
    >
    > somewhere I have seen that it is possible to create a formular
    > with a select box and without any submit button.
    >
    > if you select via the select box an item, then the new page is loaded.
    >
    > how can i do that?


    All this does is save most users a single click, while making the list
    unusable by the many people who use only the keyboard for navigation.
     
    Harlan Messinger, Jun 18, 2006
    #6
  7. =?ISO-8859-15?Q?Martin_P=F6pping?=

    htmlwoohoo

    Joined:
    Oct 6, 2007
    Messages:
    1
    the clicked page displayed in the original page

    Hello,

    What should you add to the following code to make the clicked page (Children's menus or Adults' menus) in the option display on the same page as the original page?

    <form action="test.do" method="get">
    <select name="test" onchange="submit();">
    <option>Children's menus</option>
    <option>Adults' menus</option>
    </select>
    </form>

    I've tried with target="_self" as attribute in the form but it doesn't help.

    Any input would be really appreciated.

    Eliz

     
    htmlwoohoo, Oct 6, 2007
    #7
    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. Replies:
    2
    Views:
    6,300
  2. Matthew Louden
    Replies:
    3
    Views:
    290
    Ray at
    Jan 9, 2004
  3. Gumtree
    Replies:
    3
    Views:
    264
    Matt Kruse
    Nov 10, 2004
  4. Replies:
    2
    Views:
    378
  5. jatrojoomla
    Replies:
    1
    Views:
    180
Loading...

Share This Page