This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes how to get value from combo box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to get value from combo box" Watch "how to get value from combo box" New topic

how to get value from combo box

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 301
Hello List[],

i want to display selected value in the combo box using struts.when i select combo box it should display its select value in jsp page;Please help me.

MyJsp page look like this.

<%@ page language="java" pageEncoding="ISO-8859-1" import="java.util.*" %>
<%@ taglib uri="" prefix="bean"%>
<%@ taglib uri="" prefix="html"%>

<title>JSP for SimpleForm form</title>
<script language="Javascript">
function sel_click()
var f = document.modcat;
<html:form action="/simple">
name : <html:text property="name"/><html:errors property="name"/><br/>

<html:select property="name" onchange="sel_click();"><html ptionsCollection name="simpleForm" property="smyMonth" value="key" label="value" /></html:select>
<bean:write name="simpleForm" property="name" />

André-John Mas
Ranch Hand

Joined: Oct 18, 2008
Posts: 37
In reality you are off topic here, since what you are asking is a Javascript question. I'll answer the best I can:

You need to add an onchange="" attribute to the select element and then to get the value of the select:


After that you can do what you want with it.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: how to get value from combo box
It's not a secret anymore!