DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Auto-submit Dropdown Menu

10.05.2005
| 98735 views |
  • submit to reddit
        Many users assume that a <select> element (dropdown menu)
will have its effect without pressing submit button.
(poor user...). The solution is to have it submit automatically.
<select name='myfield' onchange='this.form.submit()'>
<option .... >
...
</select>
</form>
Simply onchange='this.form.submit()'    

Comments

Snippets Manager replied on Mon, 2012/05/07 - 2:15pm

Remember to add a submit button for those who don't have javascript: ...