Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Struts
calling another .do call on changing the value from Dropdown Box
andrew ronchi
Ranch Hand
Posts: 50
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i have a dropdown box in my
struts
application. onchange,i want to call another .do call with id of that selected value...?how cn i do that...
Alberto Dousdebes
Greenhorn
Posts: 22
posted 12 years ago
2
Number of slices to send:
Optional 'thank-you' note:
Send
Hi!
You can call a JavaScript function in "onChange" event. This function retrieves the selected value and call any action you want:
<html:select name="YouForm" property="demoProp" styleClass="list-menu" onchange="functionSubmit(this)" > //html:select code goes here </html:select>
And the javaScript function
function functionSubmit(sel){ var value = sel.options[sel.selectedIndex].value; window.location = '/<%=application.getServletContextName()%>/app/action.do?requestParam=' + value; }
Havent tested but it's an idea.
bye!
john lazeraski
Ranch Hand
Posts: 77
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Are you using a library like jQuery or Prototype? If so, you can set a click handler to call a JS function, which in turn makes an ajax request to the .do action.
andrew ronchi
Ranch Hand
Posts: 50
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks a lot guys....it worked...
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Dynamic dropdownbox
Select value
Using dropdown box in JavaScript
JSP nested Select & nested Text tag
How to create a h:selectOneMenu with a default value?
More...