Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > HTML Form with a Select List and without Submit Button

Reply
Thread Tools

HTML Form with a Select List and without Submit Button

 
 
=?ISO-8859-15?Q?Martin_P=F6pping?=
Guest
Posts: n/a
 
      06-17-2006
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
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      06-17-2006
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
 
Reply With Quote
 
 
 
 
=?ISO-8859-15?Q?Martin_P=F6pping?=
Guest
Posts: n/a
 
      06-17-2006
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
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      06-17-2006
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
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      06-17-2006
Martin Pöpping <(E-Mail Removed)> 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/

 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      06-18-2006
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.
 
Reply With Quote
 
htmlwoohoo htmlwoohoo is offline
Junior Member
Join Date: Oct 2007
Posts: 1
 
      10-06-2007
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

Quote:
Originally Posted by Jonathan N. Little
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to submit a from using JavaScript [without using submit button]? jatrojoomla Javascript 1 08-24-2006 04:46 AM
submit the form data to the popup window without a submit button jrefactors@hotmail.com Javascript 2 01-01-2005 06:07 AM
submit the form data to the popup window without a submit button jrefactors@hotmail.com HTML 2 01-01-2005 06:07 AM
Submit button to select all items in a SELECT menu Gumtree Javascript 3 11-10-2004 01:45 PM
select ID in drop down list and show name in text box without clicking submit button Matthew Louden ASP General 3 01-09-2004 09:52 PM



Advertisments