Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 22nd, 2007, 03:19 PM
Registered User
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Manage ComboBox Selections within JSP


I am new to JSP and im having some difficulty finding out how to show a field in case a value of the combo box is selected. What i need is to show a different field each time a different value is selected in the combobox. How do i do this?

The code:

<logic:equal name="parCombo" value="3">
<html:select styleClass="portlet-form-input-field" property="beneficioCombo" name="vo">

<html:option value="<%= BeneficiosConstants.OPTION_APOSENTADORIA %>"><%= BeneficiosConstants.OPTION_APOSENTADORIA %></html:option>

<logic:notEqual property="beneficioComboNotFull" name="vo" value="true">

<html:option value="<%= BeneficiosConstants.OPTION_BENEFICIO_PROPORCIONAL_ DIFERIDO %>"><%= BeneficiosConstants.OPTION_BENEFICIO_PROPORCIONAL_ DIFERIDO %></html:option>



<logic:equal name="parCombo" value="1">
<%= BeneficiosConstants.OPTION_APOSENTADORIA %>
<logic:equal name="parCombo" value="2">


Old March 23rd, 2007, 08:01 AM
Friend of Wrox
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post


You can do it in multiple ways,
one you can use javascript and Ajax to get the value selected in the first combo by reading the onchange event and pass the selected value to the server using Ajax and get the list for the second field.
Second you can submit the form when the user changes selection in the first combo using javascript to the same jsp by passing the selected value as parameter and ready request parameter in the jsp to populate the second value.


Similar Threads
Thread Thread Starter Forum Replies Last Post
programmatically setting selections on a multiSELE rupen Javascript How-To 6 November 20th, 2006 10:14 AM
Two problems regarding selections freddy XSLT 10 November 3rd, 2006 07:52 PM
parameter: 6 selections maximum krema Reporting Services 0 February 20th, 2006 05:07 AM
C# ListBox Working With Multiple Selections pro-logic C# 1 October 9th, 2005 02:15 AM
Select Menu Multiple Selections phungleon HTML Code Clinic 2 July 20th, 2004 12:25 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.