• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dropdown always selects the first value

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP::

<select id="form_city" name="form" onchange=''return filterChange();''>
<option value="All">View All</option>
<option value="1">General</option>
<option value="0">Proposed</option>
</select>

function filterChange(){

document.forms["form"].submit();

}


In the front end, irrespective of what i have selected in the dropdown, it always takes "All" as selected and when submit the form "All" value goes to action every time. Please help
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before submit button write a script to set a value to ALL and then submit the form in next line by submit.form();
 
Nirmal singh Mehta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is already happening from my current code and i want only the selected from the dropdown to go to my action class. Please help
 
Ranch Hand
Posts: 47
MyEclipse IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use some jquery inside the on change event



hope this helps
 
reply
    Bookmark Topic Watch Topic
  • New Topic