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

  • 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 .... >
Simply onchange='this.form.submit()'    


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

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